org.progeeks.graph
Class ObservableAdjacencyList

java.lang.Object
  extended by org.progeeks.util.DefaultObservableList
      extended by org.progeeks.graph.ObservableAdjacencyList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, ObservableList

public class ObservableAdjacencyList
extends DefaultObservableList

An ObservableList subclass the presents a view of a graph node's adjacency set, with optional filtering.

Version:
$Revision: 1.18 $
Author:
Paul Speed
See Also:
Serialized Form

Constructor Summary
ObservableAdjacencyList()
          Creates an empty list associated with the property name "list".
ObservableAdjacencyList(com.phoenixst.plexus.Graph graph, java.lang.Object node)
          Creates a list view of the unfiltered adjacency set of the specified node in the specified graph.
ObservableAdjacencyList(com.phoenixst.plexus.Graph graph, java.lang.Object node, EdgeDefinition edgeDef)
          Creates a list view of the adjacency set defined by the specified graph, node, and edge definition.
ObservableAdjacencyList(com.phoenixst.plexus.Graph graph, java.lang.Object node, org.apache.commons.collections.Predicate filter)
          Creates a list view of the adjacency set defined by the specified graph, node, and traverser filter.
ObservableAdjacencyList(java.lang.String propertyName)
          Creates an empty list associated with the specified property name.
ObservableAdjacencyList(java.lang.String propertyName, com.phoenixst.plexus.Graph graph, java.lang.Object node)
          Creates a list view of the unfiltered adjacency set of the specified node in the specified graph.
ObservableAdjacencyList(java.lang.String propertyName, com.phoenixst.plexus.Graph graph, java.lang.Object node, EdgeDefinition edgeDef)
          Creates a list view of the adjacency set defined by the specified graph, node, and edge definition.
ObservableAdjacencyList(java.lang.String propertyName, com.phoenixst.plexus.Graph graph, java.lang.Object node, EdgeDefinition edgeDef, boolean removeOrphans)
          Creates a list view of the adjacency set defined by the specified graph, node, and edge definition.
ObservableAdjacencyList(java.lang.String propertyName, com.phoenixst.plexus.Graph graph, java.lang.Object node, org.apache.commons.collections.Predicate filter)
          Creates a list view of the adjacency set defined by the specified graph, node, and traverser filter The list will be associated with the specified property name.
ObservableAdjacencyList(java.lang.String propertyName, com.phoenixst.plexus.Graph graph, java.lang.Object node, org.apache.commons.collections.Predicate filter, boolean removeOrphans)
          Creates a list view of the adjacency set defined by the specified graph, node, and traverser filter The list will be associated with the specified property name.
 
Method Summary
protected  boolean cache(java.lang.Object o)
          Adds the object directly to the cache and fires the appropriate events.
 EdgeDefinition getEdgeDefinition()
           
 org.apache.commons.collections.Predicate getFilter()
           
 com.phoenixst.plexus.Graph getGraph()
           
 java.lang.Object getNode()
           
 boolean getRemoveOrphans()
          Returns the flag used to control orphan removal.
protected  void resetListCache()
           
 void setEdgeDefinition(EdgeDefinition edgeDef)
           
 void setFilter(org.apache.commons.collections.Predicate filter)
           
 void setGraph(com.phoenixst.plexus.Graph graph)
           
 void setNode(java.lang.Object node)
           
 void setRemoveOrphans(boolean removeOrphans)
          Set to true to cause the list to remove orphaned nodes when removing edges.
protected  boolean uncache(java.lang.Object o)
          Adds the object directly to the cache and fires the appropriate events.
 
Methods inherited from class org.progeeks.util.DefaultObservableList
add, add, addAll, addAll, addPropertyChangeListener, clear, clone, contains, containsAll, equals, fireElementsInserted, fireElementsModified, fireElementsRemoved, firePropertyChangeEvent, get, getPropertyName, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removePropertyChangeListener, retainAll, set, setList, size, subList, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObservableAdjacencyList

public ObservableAdjacencyList()
Creates an empty list associated with the property name "list". Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(java.lang.String propertyName)
Creates an empty list associated with the specified property name. Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(com.phoenixst.plexus.Graph graph,
                               java.lang.Object node,
                               EdgeDefinition edgeDef)
Creates a list view of the adjacency set defined by the specified graph, node, and edge definition. The list will be associated with the property "list". Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(com.phoenixst.plexus.Graph graph,
                               java.lang.Object node,
                               org.apache.commons.collections.Predicate filter)
Creates a list view of the adjacency set defined by the specified graph, node, and traverser filter. The list will be associated with the property "list". Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(java.lang.String propertyName,
                               com.phoenixst.plexus.Graph graph,
                               java.lang.Object node,
                               EdgeDefinition edgeDef)
Creates a list view of the adjacency set defined by the specified graph, node, and edge definition. The list will be associated with the specified property name. Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(java.lang.String propertyName,
                               com.phoenixst.plexus.Graph graph,
                               java.lang.Object node,
                               EdgeDefinition edgeDef,
                               boolean removeOrphans)
Creates a list view of the adjacency set defined by the specified graph, node, and edge definition. The list will be associated with the specified property name. The removeOrphans argument configures the node removal behavior of the list. When true, nodes with a degree of 0 after an edge removal will be removed.


ObservableAdjacencyList

public ObservableAdjacencyList(java.lang.String propertyName,
                               com.phoenixst.plexus.Graph graph,
                               java.lang.Object node,
                               org.apache.commons.collections.Predicate filter)
Creates a list view of the adjacency set defined by the specified graph, node, and traverser filter The list will be associated with the specified property name. Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(java.lang.String propertyName,
                               com.phoenixst.plexus.Graph graph,
                               java.lang.Object node)
Creates a list view of the unfiltered adjacency set of the specified node in the specified graph. The list will be associated with the specified property name. Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(com.phoenixst.plexus.Graph graph,
                               java.lang.Object node)
Creates a list view of the unfiltered adjacency set of the specified node in the specified graph. The list will be associated with the "list" property name. Orphaned nodes will not be removed when the edges are removed.


ObservableAdjacencyList

public ObservableAdjacencyList(java.lang.String propertyName,
                               com.phoenixst.plexus.Graph graph,
                               java.lang.Object node,
                               org.apache.commons.collections.Predicate filter,
                               boolean removeOrphans)
Creates a list view of the adjacency set defined by the specified graph, node, and traverser filter The list will be associated with the specified property name. The removeOrphans argument configures the node removal behavior of the list. When true, nodes with a degree of 0 after an edge removal will be removed.

Method Detail

setGraph

public final void setGraph(com.phoenixst.plexus.Graph graph)

getGraph

public com.phoenixst.plexus.Graph getGraph()

setNode

public void setNode(java.lang.Object node)

getNode

public java.lang.Object getNode()

setEdgeDefinition

public void setEdgeDefinition(EdgeDefinition edgeDef)

getEdgeDefinition

public EdgeDefinition getEdgeDefinition()

setFilter

public void setFilter(org.apache.commons.collections.Predicate filter)

getFilter

public org.apache.commons.collections.Predicate getFilter()

setRemoveOrphans

public void setRemoveOrphans(boolean removeOrphans)
Set to true to cause the list to remove orphaned nodes when removing edges. Orphaned nodes are defined as nodes with a degree of zero.


getRemoveOrphans

public boolean getRemoveOrphans()
Returns the flag used to control orphan removal.


cache

protected boolean cache(java.lang.Object o)
Adds the object directly to the cache and fires the appropriate events. This is used by the event observer code to keep the cache up-to-date.


uncache

protected boolean uncache(java.lang.Object o)
Adds the object directly to the cache and fires the appropriate events. This is used by the event observer code to keep the cache up-to-date.


resetListCache

protected void resetListCache()


Copyright © 2002-2003 Paul Speed. All Rights Reserved.