de.grogra.graph
public abstract class GraphFilter extends GraphBase implements ChangeBoundaryListener, AttributeChangeListener, EdgeChangeListener
GraphFilter is a Graph which
has another graph as source and filters the data of the source graph.
Filtering may include modification of structure and attributes.
The implementations of Graph methods in this class
just forward their invocation to the corresponding methods
of the source graph.| Modifier and Type | Class and Description |
|---|---|
class |
GraphFilter.AccessorBridge
This helper class delegates accessor method invocations
to the corresponding
get-, set-
and isWritable-methods of the enclosing graph filter. |
protected class |
GraphFilter.State |
Lockable.DeadLockException| Modifier and Type | Field and Description |
|---|---|
protected Graph |
source
The source graph whose data is filtered by this graph filter.
|
ATTRIBUTE_PRIORITY, TOPOLOGY_PRIORITY, UPDATE_PRIORITYBRANCH_EDGE, CONTAINMENT_EDGE, CONTAINMENT_END_EDGE, EDGENODE_IN_EDGE, EDGENODE_OUT_EDGE, ELLIPSE_SYMBOL, MAIN_GRAPH, MARK_EDGE, MIN_NORMAL_BIT_INDEX, MIN_UNUSED_EDGE, MIN_UNUSED_EDGE_BIT, NOTIFIES_EDGE, PERSISTENT, PERSISTENT_DELETED, RECTANGLE_SYMBOL, REFINEMENT_EDGE, RHOMBUS_SYMBOL, ROUND_RECTANGLE_SYMBOL, SPECIAL_EDGE_MASK, SPECIAL_EDGE_OF_SOURCE_BIT, STD_EDGE_5, STD_EDGE_6, SUCCESSOR_EDGE, TRANSIENT| Constructor and Description |
|---|
GraphFilter(Graph source) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
accept(java.lang.Object startNode,
Visitor visitor,
ArrayPath placeInPath,
boolean useInstancing) |
void |
attributeChanged(AttributeChangeEvent event) |
void |
beginChange(GraphState gs) |
BooleanMap |
createBooleanMap() |
protected GraphBase.State |
createMainState() |
<V> ObjectMap<V> |
createObjectMap() |
protected GraphState |
createState(ThreadContext tc) |
void |
edgeChanged(java.lang.Object source,
java.lang.Object target,
java.lang.Object edgeSet,
GraphState gs) |
void |
endChange(GraphState gs) |
AttributeAccessor |
getAccessor(java.lang.Object object,
boolean asNode,
Attribute attribute)
Returns an attribute accessor for the given attribute on the given
object.
|
Attribute[] |
getAttributes(java.lang.Object object,
boolean asNode)
Returns the set of attributes which are available for the given object.
|
protected boolean |
getBoolean(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
BooleanAttributeAccessor.getBoolean(Object, GraphState)
to this method. |
protected byte |
getByte(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ByteAttributeAccessor.getByte(Object, GraphState)
to this method. |
protected char |
getChar(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
CharAttributeAccessor.getChar(Object, GraphState)
to this method. |
int |
getColor(java.lang.Object object,
boolean asNode) |
Attribute[] |
getDependent(java.lang.Object object,
boolean asNode,
Attribute a)
Returns the set of attributes whose values depend on the given
attribute
a for the given object. |
protected Attribute[] |
getDependentOfSource(java.lang.Object object,
boolean asNode,
Attribute a) |
java.lang.Object |
getDescription(java.lang.Object object,
boolean asNode,
java.lang.String type)
Returns a description for the given object.
|
protected double |
getDouble(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
DoubleAttributeAccessor.getDouble(Object, GraphState)
to this method. |
int |
getEdgeBits(java.lang.Object edge)
Returns the edge bits of an edge.
|
java.lang.Object |
getFirstEdge(java.lang.Object node)
Returns the first edge of the linked list of edges of
node. |
protected float |
getFloat(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
FloatAttributeAccessor.getFloat(Object, GraphState)
to this method. |
long |
getId(java.lang.Object node)
Returns a unique identifier for the given
node. |
Instantiator |
getInstantiator(java.lang.Object node) |
protected int |
getInt(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
IntAttributeAccessor.getInt(Object, GraphState)
to this method. |
int |
getLifeCycleState(java.lang.Object object,
boolean asNode)
Returns the life cycle state of the given object as part of this graph.
|
protected long |
getLong(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
LongAttributeAccessor.getLong(Object, GraphState)
to this method. |
java.lang.String |
getName(java.lang.Object object,
boolean asNode)
Returns a name for the given object.
|
java.lang.Object |
getNextEdge(java.lang.Object edge,
java.lang.Object parentNode)
Returns the edge after
edge in the linked list
of edges of node. |
java.lang.Object |
getNodeForId(long persistentId)
Returns the node identified by
id. |
protected java.lang.Object |
getObject(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
java.lang.Object placeIn,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ObjectAttributeAccessor.getObject(Object, GraphState)
and ObjectAttributeAccessor.getObject(Object, Object, GraphState)
to this method. |
java.lang.Object |
getObjectForName(boolean node,
java.lang.String name)
Returns the object with the given name.
|
ObjectAttribute |
getParentAttribute()
Defines the derived attribute which has as value the parent object.
|
int |
getPriority() |
java.lang.Object |
getRoot(java.lang.String key)
Returns the root node for the given root key.
|
java.lang.String[] |
getRootKeys()
Returns the root keys for the graph.
|
protected short |
getShort(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ShortAttributeAccessor.getShort(Object, GraphState)
to this method. |
java.lang.Object |
getSourceNode(java.lang.Object edge)
Returns the source node of
edge. |
static GraphState |
getSourceState(GraphState gs) |
SpecialEdgeDescriptor[] |
getSpecialEdgeDescriptors(java.lang.Object node,
boolean asSource) |
int |
getStamp()
Returns a modification stamp for the whole graph.
|
int |
getSymbol(java.lang.Object object,
boolean asNode) |
java.lang.Object |
getTargetNode(java.lang.Object edge)
Returns the target node of
edge. |
EdgePattern |
getTreePattern()
Defines the pattern used for the construction of this graph's tree.
|
protected boolean |
isWritable(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation
of AttributeAccessor.isWritable(Object, GraphState) to
this method. |
protected boolean |
setBoolean(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
boolean value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
BooleanAttributeAccessor.setBoolean(Object, boolean, GraphState)
to this method. |
protected byte |
setByte(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
byte value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ByteAttributeAccessor.setByte(Object, byte, GraphState)
to this method. |
protected char |
setChar(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
char value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
CharAttributeAccessor.setChar(Object, char, GraphState)
to this method. |
protected double |
setDouble(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
double value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
DoubleAttributeAccessor.setDouble(Object, double, GraphState)
to this method. |
protected float |
setFloat(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
float value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
FloatAttributeAccessor.setFloat(Object, float, GraphState)
to this method. |
protected int |
setInt(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
int value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
IntAttributeAccessor.setInt(Object, int, GraphState)
to this method. |
protected long |
setLong(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
long value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
LongAttributeAccessor.setLong(Object, long, GraphState)
to this method. |
protected java.lang.Object |
setObject(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
java.lang.Object value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ObjectAttributeAccessor.setObject(Object, Object, GraphState)
to this method. |
protected short |
setShort(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
short value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ShortAttributeAccessor.setShort(Object, short, GraphState)
to this method. |
addAttributeChangeListener, addAttributeChangeListener, addChangeBoundaryListener, addEdgeChangeListener, addEdgeChangeListener, execute, execute, executeForcedly, executeForcedly, getMainState, getMaxWaitingTime, getQueueLength, getStateMap, init, isLocked, removeAttributeChangeListener, removeAttributeChangeListener, removeChangeBoundaryListener, removeEdgeChangeListener, removeEdgeChangeListenerprotected final Graph source
public GraphFilter(Graph source)
protected void accept(java.lang.Object startNode,
Visitor visitor,
ArrayPath placeInPath,
boolean useInstancing)
public void attributeChanged(AttributeChangeEvent event)
attributeChanged in interface AttributeChangeListenerpublic void beginChange(GraphState gs)
beginChange in interface ChangeBoundaryListenerpublic BooleanMap createBooleanMap()
createBooleanMap in interface Graphprotected GraphBase.State createMainState()
createMainState in class GraphBasepublic <V> ObjectMap<V> createObjectMap()
createObjectMap in interface Graphprotected GraphState createState(ThreadContext tc)
public void edgeChanged(java.lang.Object source,
java.lang.Object target,
java.lang.Object edgeSet,
GraphState gs)
edgeChanged in interface EdgeChangeListenerpublic void endChange(GraphState gs)
endChange in interface ChangeBoundaryListenerpublic AttributeAccessor getAccessor(java.lang.Object object, boolean asNode, Attribute attribute)
GraphgetAccessor in interface Graphobject - the objectasNode - true if object is a node,
false if object is an edgeattribute - the attributepublic Attribute[] getAttributes(java.lang.Object object, boolean asNode)
GraphgetAttributes in interface Graphobject - the objectasNode - true if object is a node,
false if object is an edgeprotected boolean getBoolean(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
BooleanAttributeAccessor.getBoolean(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected byte getByte(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ByteAttributeAccessor.getByte(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected char getChar(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
CharAttributeAccessor.getChar(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic int getColor(java.lang.Object object,
boolean asNode)
public Attribute[] getDependent(java.lang.Object object, boolean asNode, Attribute a)
Grapha for the given object.getDependent in interface Graphobject - the objectasNode - true if object is a node,
false if object is an edgea - the attributeprotected Attribute[] getDependentOfSource(java.lang.Object object, boolean asNode, Attribute a)
public java.lang.Object getDescription(java.lang.Object object,
boolean asNode,
java.lang.String type)
Graphtype; it is interpreted as in
Described.getDescription(String).getDescription in interface Graphobject - the objectasNode - true if object is a node,
false if object is an edgetype - the type of descriptionnullprotected double getDouble(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
DoubleAttributeAccessor.getDouble(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic int getEdgeBits(java.lang.Object edge)
GraphgetEdgeBits in interface Graphedge - the edgeGraphpublic java.lang.Object getFirstEdge(java.lang.Object node)
Graphnode.getFirstEdge in interface Graphnode - the common node of the edges of the linked listGraph,
Graph.getNextEdge(Object, Object)protected float getFloat(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
FloatAttributeAccessor.getFloat(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic long getId(java.lang.Object node)
Graphnode.getId in interface Graphnode - a nodeGraph.getNodeForId(long)public Instantiator getInstantiator(java.lang.Object node)
getInstantiator in interface Graphprotected int getInt(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
IntAttributeAccessor.getInt(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic int getLifeCycleState(java.lang.Object object,
boolean asNode)
GraphgetLifeCycleState in interface Graphobject - the object to testasNode - true if object is a node,
false if object is an edgeGraph.PERSISTENT, Graph.PERSISTENT_DELETED,
Graph.TRANSIENTprotected long getLong(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
LongAttributeAccessor.getLong(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic java.lang.String getName(java.lang.Object object,
boolean asNode)
GraphgetName in interface Graphobject - the objectasNode - true if object is a node,
false if object is an edgeGraph.getObjectForName(boolean, String)public java.lang.Object getNextEdge(java.lang.Object edge,
java.lang.Object parentNode)
Graphedge in the linked list
of edges of node.getNextEdge in interface Graphedge - the previous edge in the linked listparentNode - the common node of the edges of the linked listGraph,
Graph.getFirstEdge(Object)public java.lang.Object getNodeForId(long persistentId)
Graphid.getNodeForId in interface GraphpersistentId - an identifiernull if id
identifies no nodeGraph.getId(Object)protected java.lang.Object getObject(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
java.lang.Object placeIn,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ObjectAttributeAccessor.getObject(Object, GraphState)
and ObjectAttributeAccessor.getObject(Object, Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodplaceIn - an instance for the result may be provided by the callergs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic java.lang.Object getObjectForName(boolean node,
java.lang.String name)
Graphnull is returned.getObjectForName in interface Graphnode - true if a node of the given name is to be found,
false if an edge is to be foundname - the name of the objectnull if no such object existsGraph.getName(Object, boolean)public ObjectAttribute getParentAttribute()
GraphgetParentAttribute in interface GraphGraph,
Graph.getTreePattern()public int getPriority()
getPriority in interface ChangeBoundaryListenerpublic java.lang.Object getRoot(java.lang.String key)
GraphgetRoot in interface Graphkey - a root key, one of Graph.getRootKeys()key,
or null if no such root node existsGraphpublic java.lang.String[] getRootKeys()
GraphgetRootKeys in interface GraphGraph,
Graph.getRoot(String)protected short getShort(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ShortAttributeAccessor.getShort(Object, GraphState)
to this method. This method has to be overridden by subclasses which
make use of accessor bridges in order to return the value for
the attribute of the accessor bridge.object - the objectaccessor - the accessor bridge which invokes this methodgs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectpublic java.lang.Object getSourceNode(java.lang.Object edge)
Graphedge.getSourceNode in interface Graphedge - an edgeGraphpublic static GraphState getSourceState(GraphState gs)
public SpecialEdgeDescriptor[] getSpecialEdgeDescriptors(java.lang.Object node, boolean asSource)
getSpecialEdgeDescriptors in interface Graphpublic int getStamp()
Graphpublic int getSymbol(java.lang.Object object,
boolean asNode)
public java.lang.Object getTargetNode(java.lang.Object edge)
Graphedge.getTargetNode in interface Graphedge - an edgeGraphpublic EdgePattern getTreePattern()
GraphgetTreePattern in interface GraphGraph,
Graph.getParentAttribute()protected boolean isWritable(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation
of AttributeAccessor.isWritable(Object, GraphState) to
this method. This method has to be overridden by subclasses which
declare a writable attribute by an accessor bridge.object - an objectaccessor - an accessor bridgegs - current graph statetrue iff accessor represents
a writable attributeprotected boolean setBoolean(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
boolean value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
BooleanAttributeAccessor.setBoolean(Object, boolean, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected byte setByte(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
byte value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ByteAttributeAccessor.setByte(Object, byte, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected char setChar(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
char value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
CharAttributeAccessor.setChar(Object, char, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected double setDouble(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
double value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
DoubleAttributeAccessor.setDouble(Object, double, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected float setFloat(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
float value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
FloatAttributeAccessor.setFloat(Object, float, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected int setInt(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
int value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
IntAttributeAccessor.setInt(Object, int, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected long setLong(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
long value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
LongAttributeAccessor.setLong(Object, long, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected java.lang.Object setObject(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
java.lang.Object value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ObjectAttributeAccessor.setObject(Object, Object, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the objectprotected short setShort(java.lang.Object object,
GraphFilter.AccessorBridge accessor,
short value,
GraphState gs)
GraphFilter.AccessorBridge forwards the invocation of
ShortAttributeAccessor.setShort(Object, short, GraphState)
to this method. This method has to be overridden by subclasses which
use accessor bridges to represent writable attributes.object - the objectaccessor - the accessor bridge which invokes this methodvalue - the new value for the attributegs - current graph stateNoSuchKeyException - if the attribute is not defined for the object