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

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

public class Edge
extends java.lang.Object
implements Element, java.lang.Cloneable, java.io.Serializable

Represents a graph edge. The edge is defined by the vertices that are connected by it. Although the edge that the class represents is not directed, the vertices are named vertex A and vertex B. However, two edges where vertices A are equal to vertices B are considered equal, to preserve the non-directionability of the edge representation.

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

Method Summary
 void delete()
          Deletes the edge.
 void deselect()
          Deselects this element.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is equal to this one.
 EdgeData getData()
          Retrieves the edge data.
 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.
 Vertex getVertexA()
          Retrieves the vertex A.
 Vertex getVertexB()
          Retrieves the vertex 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(Vertex 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.
 void select()
          Selects this element.
 void setMultiplicity(int multiplicity)
          Sets the edge multiplicity.
 void setPrimarySelected()
          Sets the edge as primary 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()

getData

public EdgeData getData()
Retrieves the edge data.

Returns:
EdgeData The edge data.

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:
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(Vertex v)
Retrieves is the specified vertex incident with the edge.

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

getVertexA

public Vertex getVertexA()
Retrieves the vertex A.

Returns:
Vertex The vertex.

getVertexB

public Vertex getVertexB()
Retrieves the vertex B.

Returns:
Vertex The vertex.

delete

public void delete()
Deletes the edge.

Specified by:
delete in interface Element
See Also:
Element.delete()

setMultiplicity

public void setMultiplicity(int multiplicity)
Sets the edge multiplicity.

Parameters:
multiplicity - The edge multiplicity.

select

public void select()
Selects this element.

Specified by:
select in interface Element

deselect

public void deselect()
Deselects this element.

Specified by:
deselect in interface Element

setPrimarySelected

public void setPrimarySelected()
Sets the edge as primary selected.

Specified by:
setPrimarySelected in interface Element
See Also:
Element.setPrimarySelected()

isSelected

public boolean isSelected()
Retrieves is the edge selected.

Specified by:
isSelected in interface Element
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.