JADE v6.1

com.dautelle.physics
Class Quantity.Value

java.lang.Object
  extended bycom.dautelle.physics.Quantity.Value
Enclosing class:
Quantity

public static final class Quantity.Value
extends java.lang.Object

This inner class represents a mutable image of an imutable Quantity. Instances of this class are typically used for inter-threads communication (e.g. system state). Updates/queries do not perform heap allocation (when executed in a pool context), but usually require synchronization.


Constructor Summary
Quantity.Value(Quantity initialValue)
          Creates a mutable value for quantities of the same type than the initial value argument.
 
Method Summary
 Quantity get()
          Returns an immutable copy of this mutable value (allocated on the "stack" when the current thread execute in a pool context).
 void set(Quantity value)
          Sets the current value for this mutable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Quantity.Value

public Quantity.Value(Quantity initialValue)
Creates a mutable value for quantities of the same type than the initial value argument.

Parameters:
initialValue - the initial value, it also defines the type of quantity being held by this value.
Method Detail

get

public Quantity get()
Returns an immutable copy of this mutable value (allocated on the "stack" when the current thread execute in a pool context).

Returns:
a local immutable copy of this value.

set

public void set(Quantity value)
Sets the current value for this mutable.

Parameters:
value - the new value.
Throws:
java.lang.IllegalArgumentException - if the system unit of the specified quantity is different from the initial value system unit.
See Also:
Quantity.Value(com.dautelle.physics.Quantity)

JADE v6.1

Copyright © 2004 Jean-Marie Dautelle.