agl2.rep
Class AdjacentNodeRep
java.lang.Object
|
+--agl2.rep.AdjacentNodeRep
- All Implemented Interfaces:
- DirectedEdgeRep, EdgeRep, java.io.Serializable
- public class AdjacentNodeRep
- extends java.lang.Object
- implements DirectedEdgeRep, java.io.Serializable
The AdjacentNodeRep description.
a simple directed graph through adjacency lists.
No edge data is allowed as the representation
maintains links between nodes.
- See Also:
- Serialized Form
|
Field Summary |
protected java.util.HashMap |
adjlist
|
static java.util.HashSet |
repTags
|
|
Method Summary |
Edge |
addEdge(java.lang.Object from,
java.lang.Object to)
|
java.lang.Object |
addNode(java.lang.Object o)
Add a node to the edge rep. |
EdgeRep |
cloneRep()
|
java.util.Set |
getAdjacentEdges(java.lang.Object o)
|
java.util.Set |
getAdjacentNodes(java.lang.Object o)
|
protected java.util.HashSet |
getAdjNodeSet(java.lang.Object o)
|
Edge |
getEdge(java.lang.Object from,
java.lang.Object to)
|
java.util.Set |
getEdges()
|
java.util.Map |
getMap(GraphTag tag)
GraphTag represents map data that is exported by the
type. |
java.util.Set |
getNodes()
|
boolean |
hasEdge(java.lang.Object from,
java.lang.Object to,
Edge e)
|
boolean |
isNode(java.lang.Object v1)
|
java.util.Set |
provides()
Each EdgeRep provides certain capabilites
For example, it may support multiple edges,
or an index of the nodes. |
void |
remEdge(Edge e)
|
void |
remNode(java.lang.Object v)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
repTags
public static final java.util.HashSet repTags
adjlist
protected java.util.HashMap adjlist
AdjacentNodeRep
public AdjacentNodeRep()
getAdjNodeSet
protected java.util.HashSet getAdjNodeSet(java.lang.Object o)
cloneRep
public EdgeRep cloneRep()
- Specified by:
cloneRep in interface EdgeRep
addNode
public java.lang.Object addNode(java.lang.Object o)
- Description copied from interface:
EdgeRep
- Add a node to the edge rep.
- Specified by:
addNode in interface EdgeRep
- Returns:
- An objectof type Vertex or null (any object is a vertex)
remNode
public void remNode(java.lang.Object v)
- Specified by:
remNode in interface EdgeRep
isNode
public boolean isNode(java.lang.Object v1)
- Specified by:
isNode in interface EdgeRep
getNodes
public java.util.Set getNodes()
- Specified by:
getNodes in interface EdgeRep
addEdge
public Edge addEdge(java.lang.Object from,
java.lang.Object to)
- Specified by:
addEdge in interface EdgeRep
remEdge
public void remEdge(Edge e)
- Specified by:
remEdge in interface EdgeRep
hasEdge
public boolean hasEdge(java.lang.Object from,
java.lang.Object to,
Edge e)
getEdge
public Edge getEdge(java.lang.Object from,
java.lang.Object to)
- Specified by:
getEdge in interface EdgeRep
getAdjacentNodes
public java.util.Set getAdjacentNodes(java.lang.Object o)
- Specified by:
getAdjacentNodes in interface DirectedEdgeRep
getEdges
public java.util.Set getEdges()
- Specified by:
getEdges in interface EdgeRep
getAdjacentEdges
public java.util.Set getAdjacentEdges(java.lang.Object o)
- Specified by:
getAdjacentEdges in interface DirectedEdgeRep
provides
public java.util.Set provides()
- Description copied from interface:
EdgeRep
- Each EdgeRep provides certain capabilites
For example, it may support multiple edges,
or an index of the nodes.
Graphs can use this information to choose
a representation from the available candidates.
- Specified by:
provides in interface EdgeRep
- Returns:
- A set of GraphTag
getMap
public java.util.Map getMap(GraphTag tag)
- Description copied from interface:
EdgeRep
- GraphTag represents map data that is exported by the
type. Certain EdgeRep classes naturally provide
an efficient map. These maps can be aquired
using the getMap call. An EdgeRep may return null
to signify that the requested map is not supported.
- Specified by:
getMap in interface EdgeRep
- Returns:
- internal map for the associated tag.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object