edu.uci.ics.jung.graph.filters
Class GraphAssemblyRecord

java.lang.Object
  extended by edu.uci.ics.jung.graph.filters.GraphAssemblyRecord

public class GraphAssemblyRecord
extends Object

Contains an audit trail of a graph filtering step. Maintains the name of the filters used, a history of previous filters, and links to the original graph that was used to generate the graph.

Author:
danyelf

Field Summary
static Object FILTER_GRAPH_KEY
          The key that identifes this GraphAssemblyRecord in the UserData.
 
Method Summary
static GraphAssemblyRecord getAssemblyRecord(Graph g)
          Returns the GraphAssemblyRecord for a particular graph.
 String getName()
          Returns the name of the filter that generated this Graph.
 String getNameExtended()
          Returns the collated name of the sequence of filters.
 Graph getOriginalExtended()
          Returns the first original graph If the original graph was generated by a different filter (as in the first example at EfficientFilter, then there is a "previous" graph--and thus a previous GraphAssemblyRecord.
 Graph getOriginalGraph()
          Returns the original graph that created this subset.
 GraphAssemblyRecord getPreviousAssemblyRecord()
          Returns the GraphAssemblyRecord, if it exists, of the original graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_GRAPH_KEY

public static final Object FILTER_GRAPH_KEY
The key that identifes this GraphAssemblyRecord in the UserData.

Method Detail

getOriginalGraph

public Graph getOriginalGraph()
Returns the original graph that created this subset. Warning: because this stays around, the original Graph will NOT be garbage collected! Be sure to delete this user data if you want to allow the original graph's memory to be reallocated.

Returns:
a pointer to the original Graph.

getName

public String getName()
Returns the name of the filter that generated this Graph. If a series of filters were used (as in the second example at EfficientFilter, then they are all returned, collated together.

Returns:
the name of the filter

getPreviousAssemblyRecord

public GraphAssemblyRecord getPreviousAssemblyRecord()
Returns the GraphAssemblyRecord, if it exists, of the original graph. If the original graph was generated by a different filter (as in the first example at EfficientFilter, then there is a "previous" graph--and thus a previous GraphAssemblyRecord.


getNameExtended

public String getNameExtended()
Returns the collated name of the sequence of filters. Names are returned in reverse order, separated by ":::". If the original graph was generated by a different filter (as in the first example at EfficientFilter, then there is a "previous" graph--and thus a previous GraphAssemblyRecord. This follows the chain back and returns the collated set of names.


getOriginalExtended

public Graph getOriginalExtended()
Returns the first original graph If the original graph was generated by a different filter (as in the first example at EfficientFilter, then there is a "previous" graph--and thus a previous GraphAssemblyRecord. This follows the chain back and returns the first Graph.


getAssemblyRecord

public static GraphAssemblyRecord getAssemblyRecord(Graph g)
Returns the GraphAssemblyRecord for a particular graph. Expects the data to be stored in the user data.

Parameters:
g - A Graph that may be a filtered version of some other graph.
Returns:
The GraphAssemblyRecord associated with the graph, or null, if there isn't one.
See Also:
FILTER_GRAPH_KEY, UserDataContainer.getUserDatum(java.lang.Object)