agg.xt_basis
Class GraphObject

java.lang.Object
  extended by agg.xt_basis.GraphObject
All Implemented Interfaces:
AttrObserver, XMLObject, java.io.Serializable
Direct Known Subclasses:
Arc, Node

public abstract class GraphObject
extends java.lang.Object
implements XMLObject, AttrObserver

GraphObject defines the common interface and implementations for Nodes and Arcs.

See Also:
Serialized Form

Field Summary
protected  boolean critical
           
protected  int criticalKind
           
protected  AttrInstance itsAttr
           
protected  Graph itsContext
           
protected  java.lang.String itsContextUsage
           
protected  java.util.Vector<Arc> itsIncomingArcs
           
protected  java.util.Vector<Arc> itsOutgoingArcs
           
protected  GraphObject itsSource
           
protected  GraphObject itsTarget
           
protected  Type itsType
           
 boolean selected
           
protected  boolean visible
           
 
Fields inherited from interface agg.attribute.AttrObserver
serialVersionUID
 
Constructor Summary
protected GraphObject(AttrInstance attr, Type type, GraphObject src, GraphObject tar, Graph context)
           
 
Method Summary
protected  void addIn(GraphObject obj)
           
protected  void addOut(GraphObject obj)
           
 void attributeChanged(AttrEvent ev)
          Implements the AttrObserver.
 java.lang.String attributeToString()
           
abstract  boolean compareTo(GraphObject o)
           
 java.lang.String convertToKey()
          Converts my type to a type key string that can be used for search operations.
 void copyAttributes(GraphObject orig)
           
 void createAttributeInstance()
           
 void dispose()
           
 AttrInstance getAttribute()
          Return my attribute value.
 Graph getContext()
           
 java.lang.String getContextUsage()
           
 java.util.Enumeration<Arc> getIncomingArcs()
          Iterate through all the arcs that I am the target of.
 java.util.Vector<Arc> getIncomingArcsVec()
           
 int getNumberOfArcs()
           
 int getNumberOfAttributes()
           
 int getNumberOfIncomingArcs()
           
 int getNumberOfIncomingArcs(Type t)
           
 int getNumberOfIncomingArcs(Type t, Type src)
           
 int getNumberOfInOutArcs()
           
 int getNumberOfOutgoingArcs()
           
 int getNumberOfOutgoingArcs(Type t)
           
 int getNumberOfOutgoingArcs(Type t, Type tar)
           
 java.util.Enumeration<Arc> getOutgoingArcs()
          Iterate through all the arcs that I am the source of.
 java.util.Vector<Arc> getOutgoingArcsVec()
           
 Type getType()
          Return my type.
 java.util.Vector<java.lang.String> getVariableNamesOfAttribute()
           
 boolean hasIncomingArcFrom(Type t)
           
 boolean hasOutgoingArcTo(Type t)
           
abstract  boolean isArc()
           
 boolean isCritical()
           
abstract  boolean isNode()
           
 boolean isPersistentFor(AttrTuple at)
           
 boolean isVisible()
           
protected  void removeIn(GraphObject obj)
           
protected  void removeOut(GraphObject obj)
           
 void setContextUsage(java.lang.String aContextUsage)
           
 void setCritical(boolean b)
           
 void setType(Type type)
           
 void setVisible(boolean b)
           
abstract  void XreadObject(XMLHelper h)
           
abstract  void XwriteObject(XMLHelper h)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itsContext

protected Graph itsContext

itsType

protected Type itsType

itsAttr

protected AttrInstance itsAttr

itsOutgoingArcs

protected final java.util.Vector<Arc> itsOutgoingArcs

itsIncomingArcs

protected final java.util.Vector<Arc> itsIncomingArcs

itsSource

protected GraphObject itsSource

itsTarget

protected GraphObject itsTarget

itsContextUsage

protected java.lang.String itsContextUsage

critical

protected boolean critical

criticalKind

protected int criticalKind

visible

protected boolean visible

selected

public boolean selected
Constructor Detail

GraphObject

protected GraphObject(AttrInstance attr,
                      Type type,
                      GraphObject src,
                      GraphObject tar,
                      Graph context)
Parameters:
context - The graph/subgraph context in which to consider incoming and outgoing arcs.
Method Detail

createAttributeInstance

public void createAttributeInstance()

dispose

public void dispose()

getContextUsage

public final java.lang.String getContextUsage()

setContextUsage

public final void setContextUsage(java.lang.String aContextUsage)

getContext

public final Graph getContext()

setCritical

public void setCritical(boolean b)

isCritical

public boolean isCritical()

setVisible

public void setVisible(boolean b)

isVisible

public boolean isVisible()

isArc

public abstract boolean isArc()

isNode

public abstract boolean isNode()

compareTo

public abstract boolean compareTo(GraphObject o)

XwriteObject

public abstract void XwriteObject(XMLHelper h)
Specified by:
XwriteObject in interface XMLObject

XreadObject

public abstract void XreadObject(XMLHelper h)
Specified by:
XreadObject in interface XMLObject

getType

public final Type getType()
Return my type.


setType

public final void setType(Type type)

getNumberOfArcs

public final int getNumberOfArcs()

getIncomingArcs

public final java.util.Enumeration<Arc> getIncomingArcs()
Iterate through all the arcs that I am the target of. Enumeration elements are of type Arc.

See Also:
Arc

getIncomingArcsVec

public final java.util.Vector<Arc> getIncomingArcsVec()

getNumberOfIncomingArcs

public final int getNumberOfIncomingArcs()

getNumberOfIncomingArcs

public final int getNumberOfIncomingArcs(Type t)

getNumberOfIncomingArcs

public final int getNumberOfIncomingArcs(Type t,
                                         Type src)

hasIncomingArcFrom

public boolean hasIncomingArcFrom(Type t)

getOutgoingArcs

public java.util.Enumeration<Arc> getOutgoingArcs()
Iterate through all the arcs that I am the source of. Enumeration elements are of type Arc.

See Also:
Arc

getNumberOfOutgoingArcs

public int getNumberOfOutgoingArcs()

getOutgoingArcsVec

public java.util.Vector<Arc> getOutgoingArcsVec()

getNumberOfOutgoingArcs

public final int getNumberOfOutgoingArcs(Type t)

getNumberOfOutgoingArcs

public final int getNumberOfOutgoingArcs(Type t,
                                         Type tar)

hasOutgoingArcTo

public boolean hasOutgoingArcTo(Type t)

getNumberOfInOutArcs

public int getNumberOfInOutArcs()

addOut

protected final void addOut(GraphObject obj)

addIn

protected final void addIn(GraphObject obj)

removeOut

protected final void removeOut(GraphObject obj)

removeIn

protected final void removeIn(GraphObject obj)

convertToKey

public java.lang.String convertToKey()
Converts my type to a type key string that can be used for search operations. For a node it is similar to ((Node) this).getType().convertToKey() , for an edge to ((Arc) this).getSource().getType().convertToKey() + ((Arc) this).getType().convertToKey() + ((Arc) this).getTarget().getType().convertToKey()


getAttribute

public final AttrInstance getAttribute()
Return my attribute value.


getNumberOfAttributes

public int getNumberOfAttributes()

getVariableNamesOfAttribute

public final java.util.Vector<java.lang.String> getVariableNamesOfAttribute()

copyAttributes

public void copyAttributes(GraphObject orig)

attributeChanged

public void attributeChanged(AttrEvent ev)
Implements the AttrObserver. Propagates the change agg.util.Change.OBJECT_MODIFIED and object Pair (this, ev.getID()) to its Graph if the attributes are changed.

Specified by:
attributeChanged in interface AttrObserver

attributeToString

public java.lang.String attributeToString()

isPersistentFor

public boolean isPersistentFor(AttrTuple at)
Specified by:
isPersistentFor in interface AttrObserver