com.sun.sgs.impl.service.nodemap.affinity.graph
Class WeightedEdge

java.lang.Object
  extended by com.sun.sgs.impl.service.nodemap.affinity.graph.WeightedEdge

public class WeightedEdge
extends Object

An edge with an associated weight.


Constructor Summary
WeightedEdge()
          Constructs a weighted edge with an initial weight of 1.
WeightedEdge(long value)
          Constructs a weighted edge with an initial weight of value.
 
Method Summary
 void addWeight(long value)
          Adds the given value to the edge weight.
 long getWeight()
          Returns the weight of this edge.
 void incrementWeight()
          Increments the edge weight.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WeightedEdge

public WeightedEdge()
Constructs a weighted edge with an initial weight of 1.


WeightedEdge

public WeightedEdge(long value)
Constructs a weighted edge with an initial weight of value.

Parameters:
value - the initial weight
Method Detail

getWeight

public long getWeight()
Returns the weight of this edge. Edge weights represent the number of times both vertices that this edge connects have accessed the same object. For example, if both vertices access object1 two times, the returned weight is 2. If they both access a different object, object2, once, the weight will now be 3.

Returns:
the weight of this edge

incrementWeight

public void incrementWeight()
Increments the edge weight.


addWeight

public void addWeight(long value)
Adds the given value to the edge weight.

Parameters:
value - the value to add to the weight

toString

public String toString()

Overrides:
toString in class Object

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved