public class HashSetNodeEventListener extends Object implements Graph.NodeEventListener
Graph.NodeEventListener
implementation that accumulates event nodes in a
HashSet
.Modifier and Type | Field and Description |
---|---|
private Set<Graph.NodeEvent> |
filter |
private Set<Node> |
nodes |
Constructor and Description |
---|
HashSetNodeEventListener()
Creates a
Graph.NodeEventListener that collects nodes from all events. |
HashSetNodeEventListener(Set<Graph.NodeEvent> filter)
Creates a
Graph.NodeEventListener that collects nodes from all events that match a given
filter. |
Modifier and Type | Method and Description |
---|---|
void |
event(Graph.NodeEvent e,
Node node)
Default handler for events.
|
HashSetNodeEventListener |
exclude(Graph.NodeEvent e)
Excludes a given event from those for which nodes are collected.
|
Set<Node> |
getNodes()
Gets the set being used to accumulate the nodes communicated to this listener.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inputChanged, nodeAdded, usagesDroppedToZero
public HashSetNodeEventListener()
Graph.NodeEventListener
that collects nodes from all events.public HashSetNodeEventListener(Set<Graph.NodeEvent> filter)
Graph.NodeEventListener
that collects nodes from all events that match a given
filter.public HashSetNodeEventListener exclude(Graph.NodeEvent e)
public void event(Graph.NodeEvent e, Node node)
Graph.NodeEventListener
event
in interface Graph.NodeEventListener
e
- an eventnode
- the node related to e