de.cau.cs.kieler.klodd.hierarchical.structures
Class LinearSegment

java.lang.Object
  extended by de.cau.cs.kieler.klodd.hierarchical.structures.LinearSegment
All Implemented Interfaces:
Comparable<LinearSegment>

public class LinearSegment
extends Object
implements Comparable<LinearSegment>

A linear segment of layer elements that represents a long edge in a layered graph.

Rating proposed yellow
(2009-12-11) msp

Constructor Summary
LinearSegment()
           
 
Method Summary
 int compareTo(LinearSegment other)
          Compares this with another Object.
 boolean equals(Object obj)
          
 List<LayerElement> getElements()
          Returns the elements.
 int getRank()
          Returns the rank.
 boolean hasFollowing(LayerElement elem)
          Determines whether the given element has following elements in this linear segment.
 int hashCode()
          
 boolean hasPreceding(LayerElement elem)
          Determines whether the given element has preceding elements in this linear segment.
 void setRank(int therank)
          Sets the rank.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearSegment

public LinearSegment()
Method Detail

hasPreceding

public boolean hasPreceding(LayerElement elem)
Determines whether the given element has preceding elements in this linear segment.

Parameters:
elem - element to test
Returns:
true if there are other elements before elem

hasFollowing

public boolean hasFollowing(LayerElement elem)
Determines whether the given element has following elements in this linear segment.

Parameters:
elem - element to test
Returns:
true if there are other elements after elem

toString

public String toString()

Overrides:
toString in class Object

compareTo

public int compareTo(LinearSegment other)
Compares this with another Object. Returns -1 if this object is smaller, 0 if both objects are equal and 1 if this object is bigger.

Specified by:
compareTo in interface Comparable<LinearSegment>
Parameters:
other - the object to compare with
Returns:
one of the values -1, 0, 1

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

getElements

public List<LayerElement> getElements()
Returns the elements.

Returns:
the elements

setRank

public void setRank(int therank)
Sets the rank.

Parameters:
therank - the rank to set

getRank

public int getRank()
Returns the rank.

Returns:
the rank