info.aduna.linkmap.graph
Interface Vertex

All Superinterfaces:
Highlightable
All Known Implementing Classes:
VertexImpl

public interface Vertex
extends Highlightable

A Vertex represents a node in a Graph. A Vertex has knowledge about the Edges connected to it, and offers utility methods for retrieving neighbouring Vertices in the Graph.


Method Summary
 void add(Edge edge)
          Adds an Edge to the set of Edges of this Vertex.
 Collection<Vertex> getConnectedVertices()
          Returns a set containing all Vertices that are connected to this Vertex following zero (!) or more Edges in the Graph.
 Collection<Vertex> getConnectedVertices(int nrLevels)
          Returns a set containing all Vertices that are connected to this Vertex following zero or more Edges in the Graph, with the specified number as an upper bound of the number of Edges that may be followed.
 Collection<Vertex> getConnectedVertices(int nrLevels, Collection<Vertex> allowedVertices, Collection<Edge> allowedEdges)
          Returns a set containing all Vertices that are connected to this Vertex following zero or more Edges in the Graph, with the specified number as an upper bound of the number of Edges that may be followed.
 Collection<Edge> getEdges()
          Returns the set of Edges of this Vertex.
 String getLabel()
          The text to display along the Vertex' node.
 Object getLayoutAttribute()
          Returns the layout attribute of this Vertex.
 Collection<Vertex> getNeighbours()
          Returns the set of all Vertices that are directly connected to this Vertex.
 Object getRenderingAttribute()
          Returns the rendering attribute of this Vertex.
 float getWeight()
          The weight of the Vertex.
 boolean isConnectedBy(Edge edge)
          Returns whether this Vertex is connected to the specified Edge.
 boolean isConnectedTo(Vertex vertex)
          Returns whether this Vertex is directly connected to the specified Vertex by an Edge.
 boolean remove(Edge edge)
          Removes an Edge from the set of Edges of this Vertex.
 void setLayoutAttribute(Object layoutAttribute)
          Sets the layout attribute of this Vertex.
 void setRenderingAttribute(Object renderingAttribute)
          Sets the rendering attribute of this Vertex.
 
Methods inherited from interface info.aduna.linkmap.graph.Highlightable
getHighlightLevel, setHighlightLevel
 

Method Detail

getLabel

String getLabel()
The text to display along the Vertex' node.


getWeight

float getWeight()
The weight of the Vertex. This may influence both graph layout and rendering. Defaults to 1.0.


add

void add(Edge edge)
Adds an Edge to the set of Edges of this Vertex.


remove

boolean remove(Edge edge)
Removes an Edge from the set of Edges of this Vertex.

Returns:
'true' when the Edge was present before in the set of Edges, 'false' otherwise.

getEdges

Collection<Edge> getEdges()
Returns the set of Edges of this Vertex.


getLayoutAttribute

Object getLayoutAttribute()
Returns the layout attribute of this Vertex.


setLayoutAttribute

void setLayoutAttribute(Object layoutAttribute)
Sets the layout attribute of this Vertex.


getRenderingAttribute

Object getRenderingAttribute()
Returns the rendering attribute of this Vertex.


setRenderingAttribute

void setRenderingAttribute(Object renderingAttribute)
Sets the rendering attribute of this Vertex.


isConnectedTo

boolean isConnectedTo(Vertex vertex)
Returns whether this Vertex is directly connected to the specified Vertex by an Edge.


isConnectedBy

boolean isConnectedBy(Edge edge)
Returns whether this Vertex is connected to the specified Edge.


getNeighbours

Collection<Vertex> getNeighbours()
Returns the set of all Vertices that are directly connected to this Vertex.


getConnectedVertices

Collection<Vertex> getConnectedVertices()
Returns a set containing all Vertices that are connected to this Vertex following zero (!) or more Edges in the Graph. This includes the Vertex itself. During this traversal possible directionality of the Edges is ignored.


getConnectedVertices

Collection<Vertex> getConnectedVertices(int nrLevels)
Returns a set containing all Vertices that are connected to this Vertex following zero or more Edges in the Graph, with the specified number as an upper bound of the number of Edges that may be followed. During this traversal possible directionality of the Edges is ignored. If the specified number is zero, only a set containing this Vertex will be returned. If the specified number is less than zero, an infinite number of Edges may be followed.


getConnectedVertices

Collection<Vertex> getConnectedVertices(int nrLevels,
                                        Collection<Vertex> allowedVertices,
                                        Collection<Edge> allowedEdges)
Returns a set containing all Vertices that are connected to this Vertex following zero or more Edges in the Graph, with the specified number as an upper bound of the number of Edges that may be followed.

The specified Collections can be used to restrict the traversal of the Graph to a specific set of Vertices and/or Edges. This is for example useful when a Vertex belonging to a certain Graph has references to Edges and other Vertices not belonging to the same Graph (which may happen when the Graph is a subgraph of another Graph). Specifying 'null' means that the Vertices or Edges should not be checked this way.

If the specified number is zero, only a set containing this Vertex will be returned. If the specified number is less than zero, an infinite number of Edges may be followed.



Copyright © 1997-2008 Aduna. All Rights Reserved.