Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.uci.ics.jung.graph.filters
Class GeneralVertexAcceptFilter

    java.lang.Object
      edu.uci.ics.jung.graph.filters.GeneralVertexAcceptFilter

All Implemented Interfaces:
  Filter

Direct Known Subclasses:
  AlphabeticVertexFilter, DropSoloNodesFilter, NumericDecorationFilter, TrivialFilter, VertexPredicateFilter

public abstract class GeneralVertexAcceptFilter
extends Object
implements Filter

Abstract class that implements a generic filter for accepting arbitrary vertices (and all edges). To use it, subclass this and override `acceptEdge`. This is compatible with both `EfficientFilter`; in order to use it as such, make sure to label your class as an `EfficientFilter` with `implements EfficientFilter`.

See sample code at ``GeneralEdgeAcceptFilter``

Author:
  danyelf

Constructor Summary
`GeneralVertexAcceptFilter()`

Method Summary
`abstract boolean` | `acceptVertex(Vertex vert)`
`UnassembledGraph` | `filter(Graph g)` This method does the actual filtering of the the graph.
`UnassembledGraph` | `filter(UnassembledGraph g)` Returns an `UnassembledGraph` with the subset of vertices that pass `acceptEdge`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface edu.uci.ics.jung.graph.filters.Filter
`getName`

Constructor Detail

### GeneralVertexAcceptFilter

    public GeneralVertexAcceptFilter()

Method Detail

### acceptVertex

    public abstract boolean acceptVertex(Vertex vert)

### filter

    public UnassembledGraph filter(Graph g)

  This method does the actual filtering of the the graph. It walks through the set of accepted vertices, and examines each in turn to see whether it is accepted by acceptVertex. If so, it adds it to the set; if not, it discards it. This set of filtered vertices is then sent to the FilteredGraph class.

  Specified by:
    `filter` in interface `Filter`
  Parameters:
    `g` - An input graph to be filtered.
  Returns:
    an `UnassembledGraph` that contains the subset of vertices and edges from `g` pass the filter.

### filter

    public UnassembledGraph filter(UnassembledGraph g)

  Returns an `UnassembledGraph` with the subset of vertices that pass `acceptEdge`. This method is used only if this class implements `EfficientFilter`, and, in fact, it contains a runtime check to ensure that the subclass has been labelled correctly.

  Parameters:
    `g` - An `UnassembledGraph` containing a subset of vertices and edges from an original graph.
  Returns:
    An UnassembledGraph containing the subset of `ug` that pass the filter.
  See Also:
    `EfficientFilter.filter(UnassembledGraph)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD