edu.uci.ics.jung.graph.decorators
Class NumericDecorator

java.lang.Object
  extended byedu.uci.ics.jung.graph.decorators.Decorator
      extended byedu.uci.ics.jung.graph.decorators.NumericDecorator

public class NumericDecorator
extends Decorator

Decorator for any value type that extends the java.lang.Number class

Author:
Scott White

Constructor Summary
NumericDecorator(java.lang.Object key, UserDataContainer.CopyAction copyAction)
          Constructs and initializes the decorator
 
Method Summary
 java.lang.Number getValue(UserDataContainer udc)
          Returns the decorated value as Number
 int intValue(UserDataContainer udc)
          Retrieves the decorated value for the given graph/vertex/edge as an integer
 void setValue(java.lang.Number value, UserDataContainer udc)
          Sets the value for a given graph/vertex/edge
 
Methods inherited from class edu.uci.ics.jung.graph.decorators.Decorator
getCopyAction, getKey, hashCode, removeValue
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericDecorator

public NumericDecorator(java.lang.Object key,
                        UserDataContainer.CopyAction copyAction)
Constructs and initializes the decorator

Parameters:
key -
copyAction -
Method Detail

intValue

public int intValue(UserDataContainer udc)
Retrieves the decorated value for the given graph/vertex/edge as an integer

Parameters:
udc - the graph/vertex/edge
Returns:
the integer value

getValue

public java.lang.Number getValue(UserDataContainer udc)
Returns the decorated value as Number

Parameters:
udc - the graph/vertex/edge
Returns:
the value

setValue

public void setValue(java.lang.Number value,
                     UserDataContainer udc)
Sets the value for a given graph/vertex/edge

Parameters:
value - the value to be stored
udc - the graph/vertex/edge being decorated