scg.ac.ni.pmf.newgraph.graphdata
Class EdgeData

java.lang.Object
  extended by scg.ac.ni.pmf.newgraph.graphdata.EdgeData
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable, ElementData

public final class EdgeData
extends java.lang.Object
implements ElementData, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

Represents the data which defines an edge. It has the IDs of the both vertices and the multiplicity of the edge. It also implements the basic methods for manipulating edges as the data structure, such as hash tables and sorting algorithms.

The class can only report info about the edge, it can not change it. For changing the edge, the class Edge is used.

Author:
Vladimir Brankov
See Also:
Edge, Graph, Serialized Form

Method Summary
 int compareTo(java.lang.Object o)
          Compares the object.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is equal to this one.
 int getIDA()
          Retrieves the ID of the vertex A.
 int getIDB()
          Retrieves the ID of the vertex B.
 int getMultiplicity()
          Retrieves the multiplicity of the edge.
 VertexData getVertexA()
          Retrieves the vertex data A.
 VertexData getVertexB()
          Retrieves the vertex data B.
 int hashCode()
          Returns a hash code value for the object.
 boolean isIncident(int id)
          Retrieves is the specified vertex incident with the edge.
 boolean isIncident(VertexData v)
          Retrieves is the specified vertex incident with the edge.
 boolean isPrimarySelected()
          Retrieves is the edge primary selected.
 boolean isSelected()
          Retrieves is the edge selected.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is equal to this one.

Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

compareTo

public int compareTo(java.lang.Object o)
Compares the object.

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(Object)

getIDA

public int getIDA()
Retrieves the ID of the vertex A.

Returns:
int The ID.

getIDB

public int getIDB()
Retrieves the ID of the vertex B.

Returns:
int The ID.

getMultiplicity

public int getMultiplicity()
Retrieves the multiplicity of the edge.

Returns:
int The multiplicity.

isIncident

public boolean isIncident(int id)
Retrieves is the specified vertex incident with the edge.

Parameters:
id - The ID of the vertex.
Returns:
boolean Indicates is the specified vertex incident with the edge.

isIncident

public boolean isIncident(VertexData v)
Retrieves is the specified vertex incident with the edge.

Parameters:
v - The vertex data.
Returns:
boolean Indicates is the specified vertex incident with the edge.

getVertexA

public VertexData getVertexA()
Retrieves the vertex data A.

Returns:
VertexData The vertex data.

getVertexB

public VertexData getVertexB()
Retrieves the vertex data B.

Returns:
VertexData The vertex data.

isSelected

public boolean isSelected()
Retrieves is the edge selected.

Specified by:
isSelected in interface ElementData
Returns:
boolean Indicates whether the edge is selected.

isPrimarySelected

public boolean isPrimarySelected()
Retrieves is the edge primary selected.

Returns:
boolean Indicates whether the edge is primary selected.


Copyright © 2004 Dragan Stevanovic, Vladimir Brankov.