info.aduna.linkmap.graph.impl
Class VertexImpl

java.lang.Object
  extended by info.aduna.linkmap.graph.impl.VertexImpl
All Implemented Interfaces:
Highlightable, Vertex

public class VertexImpl
extends Object
implements Vertex


Constructor Summary
VertexImpl()
           
 
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.
 float getHighlightLevel()
           
 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 setHighlightLevel(float highlightLevel)
           
 void setLabel(String label)
           
 void setLayoutAttribute(Object layoutAttribute)
          Sets the layout attribute of this Vertex.
 void setRenderingAttribute(Object renderingAttribute)
          Sets the rendering attribute of this Vertex.
 void setWeight(float weight)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VertexImpl

public VertexImpl()
Method Detail

setLabel

public void setLabel(String label)

getLabel

public String getLabel()
Description copied from interface: Vertex
The text to display along the Vertex' node.

Specified by:
getLabel in interface Vertex

setWeight

public void setWeight(float weight)

getWeight

public float getWeight()
Description copied from interface: Vertex
The weight of the Vertex. This may influence both graph layout and rendering. Defaults to 1.0.

Specified by:
getWeight in interface Vertex

add

public void add(Edge edge)
Description copied from interface: Vertex
Adds an Edge to the set of Edges of this Vertex.

Specified by:
add in interface Vertex

remove

public boolean remove(Edge edge)
Description copied from interface: Vertex
Removes an Edge from the set of Edges of this Vertex.

Specified by:
remove in interface Vertex
Returns:
'true' when the Edge was present before in the set of Edges, 'false' otherwise.

getEdges

public Collection<Edge> getEdges()
Description copied from interface: Vertex
Returns the set of Edges of this Vertex.

Specified by:
getEdges in interface Vertex

getLayoutAttribute

public Object getLayoutAttribute()
Description copied from interface: Vertex
Returns the layout attribute of this Vertex.

Specified by:
getLayoutAttribute in interface Vertex

setLayoutAttribute

public void setLayoutAttribute(Object layoutAttribute)
Description copied from interface: Vertex
Sets the layout attribute of this Vertex.

Specified by:
setLayoutAttribute in interface Vertex

getRenderingAttribute

public Object getRenderingAttribute()
Description copied from interface: Vertex
Returns the rendering attribute of this Vertex.

Specified by:
getRenderingAttribute in interface Vertex

setRenderingAttribute

public void setRenderingAttribute(Object renderingAttribute)
Description copied from interface: Vertex
Sets the rendering attribute of this Vertex.

Specified by:
setRenderingAttribute in interface Vertex

setHighlightLevel

public void setHighlightLevel(float highlightLevel)
Specified by:
setHighlightLevel in interface Highlightable

getHighlightLevel

public float getHighlightLevel()
Specified by:
getHighlightLevel in interface Highlightable

isConnectedTo

public boolean isConnectedTo(Vertex vertex)
Description copied from interface: Vertex
Returns whether this Vertex is directly connected to the specified Vertex by an Edge.

Specified by:
isConnectedTo in interface Vertex

isConnectedBy

public boolean isConnectedBy(Edge edge)
Description copied from interface: Vertex
Returns whether this Vertex is connected to the specified Edge.

Specified by:
isConnectedBy in interface Vertex

getNeighbours

public Collection<Vertex> getNeighbours()
Description copied from interface: Vertex
Returns the set of all Vertices that are directly connected to this Vertex.

Specified by:
getNeighbours in interface Vertex

getConnectedVertices

public Collection<Vertex> getConnectedVertices()
Description copied from interface: Vertex
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.

Specified by:
getConnectedVertices in interface Vertex

getConnectedVertices

public Collection<Vertex> getConnectedVertices(int nrLevels)
Description copied from interface: Vertex
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.

Specified by:
getConnectedVertices in interface Vertex

getConnectedVertices

public Collection<Vertex> getConnectedVertices(int nrLevels,
                                               Collection<Vertex> allowedVertices,
                                               Collection<Edge> allowedEdges)
Description copied from interface: Vertex
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.

Specified by:
getConnectedVertices in interface Vertex


Copyright © 1997-2008 Aduna. All Rights Reserved.