graphlab.library
Class BaseEdge<VertexType extends BaseVertex>

java.lang.Object
  extended by graphlab.library.BaseEdge<VertexType>
All Implemented Interfaces:
java.lang.Comparable<BaseEdge<VertexType>>
Direct Known Subclasses:
EdgeModel, SimpleEdge, TestNewEdge

public class BaseEdge<VertexType extends BaseVertex>
extends java.lang.Object
implements java.lang.Comparable<BaseEdge<VertexType>>

The base class for all edges. By default each vertex has two integer properties, color and weight.

Author:
Omid Aladini

Field Summary
 VertexType head
           
 VertexType tail
           
 
Constructor Summary
BaseEdge(VertexType head, VertexType tail)
           
BaseEdge(VertexType head, VertexType tail, BaseEdgeProperties prop)
           
 
Method Summary
 int compareTo(BaseEdge<VertexType> o)
          Compares two edges according to their wrights.
 int getColor()
          Returns the color of the edge.
 boolean getMark()
          Returns the mark of the edge.
 BaseEdgeProperties getProp()
          Returns property object for this edge.
 int getWeight()
          Returns the weight of the edge.
 void setColor(int color)
          Sets the color of the edge.
 void setMark(boolean m)
          Sets the mark of the edge.
 void setProp(BaseEdgeProperties prop)
          Sets properties object for this edge; Overwrites the existing.
 void setWeight(int weight)
          Sets the weight of the edge.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

head

public final VertexType extends BaseVertex head

tail

public final VertexType extends BaseVertex tail
Constructor Detail

BaseEdge

public BaseEdge(VertexType head,
                VertexType tail)

BaseEdge

public BaseEdge(VertexType head,
                VertexType tail,
                BaseEdgeProperties prop)
Method Detail

getColor

public int getColor()
Returns the color of the edge.

Returns:
The color associated with the edge.

setColor

public void setColor(int color)
Sets the color of the edge.

Parameters:
col - Sets col as the color of the edge.

getWeight

public int getWeight()
Returns the weight of the edge.

Returns:
The weight associated with the edge.

setWeight

public void setWeight(int weight)
Sets the weight of the edge.

Parameters:
w - Sets w as the color of the edge.

getMark

public boolean getMark()
Returns the mark of the edge.

Returns:
The mark associated with the edge.

setMark

public void setMark(boolean m)
Sets the mark of the edge.

Parameters:
m - Sets m as the mark of the edge.

setProp

public void setProp(BaseEdgeProperties prop)
Sets properties object for this edge; Overwrites the existing.

Parameters:
prop - The property object to set.

getProp

public BaseEdgeProperties getProp()
Returns property object for this edge.

Returns:
Returns property object for this edge.

compareTo

public int compareTo(BaseEdge<VertexType> o)
Compares two edges according to their wrights.

Specified by:
compareTo in interface java.lang.Comparable<BaseEdge<VertexType extends BaseVertex>>
Parameters:
o - Edge to compare.
Returns:
0 if two objects are equal, -1 if this object is less than and 1 if this object is greater than the supplied object.