de.cesr.more.basic.edge
Class MEdge<V>

java.lang.Object
  extended by de.cesr.more.basic.edge.MEdge<V>
All Implemented Interfaces:
MoreEdge<V>, MoreFadingWeightEdge, MoreTraceableEdge<V>
Direct Known Subclasses:
MGeoEdge

public class MEdge<V>
extends Object
implements MoreEdge<V>, MoreTraceableEdge<V>, MoreFadingWeightEdge

Default MORe edge

Date:
03.12.2010

Field Summary
protected  boolean active
           
protected  boolean directed
           
protected  V end
           
protected  double fadeAmount
           
protected  V start
           
protected  double weight
           
 
Constructor Summary
MEdge(V start, V end)
          Creates an undirected edge.
MEdge(V start, V end, boolean directed)
           
MEdge(V start, V end, boolean directed, double weight)
           
 
Method Summary
 void activate()
          Mark the edge active for the current tick.
 void fadeWeight()
          Fades the edge weight by MNetManipulatePa.DYN_FADE_OUT_AMOUNT.
 V getEnd()
          For undirected edges, it returns the node that was given as second node parameter.
 V getStart()
          For undirected edges, it returns the node that was given as first node parameter.
 double getWeight()
           
 int hashCode()
           
 boolean isActive()
          True if the edge was/is active during the current tick.
 boolean isDirected()
           
 void setWeight(double weight)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

start

protected V start

end

protected V end

weight

protected double weight

directed

protected boolean directed

active

protected boolean active

fadeAmount

protected double fadeAmount
Constructor Detail

MEdge

public MEdge(V start,
             V end)
Creates an undirected edge.

Parameters:
start -
end -

MEdge

public MEdge(V start,
             V end,
             boolean directed)
Parameters:
start -
end -
directed -

MEdge

public MEdge(V start,
             V end,
             boolean directed,
             double weight)
Parameters:
start -
end -
directed -
weight -
Method Detail

getEnd

public V getEnd()
Description copied from interface: MoreEdge
For undirected edges, it returns the node that was given as second node parameter.

Specified by:
getEnd in interface MoreEdge<V>
Returns:
the edge's target node
See Also:
MoreEdge.getEnd()

getStart

public V getStart()
Description copied from interface: MoreEdge
For undirected edges, it returns the node that was given as first node parameter.

Specified by:
getStart in interface MoreEdge<V>
Returns:
the edge's start node
See Also:
MoreEdge.getStart()

getWeight

public double getWeight()
Specified by:
getWeight in interface MoreEdge<V>
Returns:
the weight that is associated with this edge
See Also:
MoreEdge.getWeight()

setWeight

public void setWeight(double weight)
Specified by:
setWeight in interface MoreEdge<V>
Parameters:
weight - that is associated with this edge
See Also:
MoreEdge.setWeight(double)

toString

public String toString()
Overrides:
toString in class Object

isDirected

public boolean isDirected()
Specified by:
isDirected in interface MoreEdge<V>
Returns:
true if this edge is directed
See Also:
MoreEdge.isDirected()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

activate

public void activate()
Description copied from interface: MoreTraceableEdge
Mark the edge active for the current tick.

Specified by:
activate in interface MoreTraceableEdge<V>
See Also:
MoreTraceableEdge.activate()

isActive

public boolean isActive()
Description copied from interface: MoreTraceableEdge
True if the edge was/is active during the current tick.

Specified by:
isActive in interface MoreTraceableEdge<V>
Returns:
See Also:
MoreTraceableEdge.isActive()

fadeWeight

public void fadeWeight()
Description copied from interface: MoreFadingWeightEdge
Fades the edge weight by MNetManipulatePa.DYN_FADE_OUT_AMOUNT.

Specified by:
fadeWeight in interface MoreFadingWeightEdge
See Also:
MoreFadingWeightEdge.fadeWeight()