ptolemy.math
Class Overflow.Saturate

java.lang.Object
  extended by ptolemy.math.Overflow
      extended by ptolemy.math.Overflow.Saturate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Enclosing class:
Overflow

public static class Overflow.Saturate
extends Overflow

The saturate overflows strategy.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.math.Overflow
Overflow.Grow, Overflow.Minimize, Overflow.Modulo, Overflow.Saturate, Overflow.ToZero, Overflow.Trap
 
Field Summary
 
Fields inherited from class ptolemy.math.Overflow
CLIP, GENERAL, GROW, MINIMIZE, MODULO, SATURATE, THROW, TO_ZERO, TRAP, WRAP
 
Constructor Summary
private Overflow.Saturate()
           
 
Method Summary
 java.math.BigInteger minusInfinity(Quantization quant)
          Return the value of minus infinity, or null if unrepresentable.
 java.math.BigInteger plusInfinity(Quantization quant)
          Return the value of plus infinity, or null if unrepresentable.
 FixPoint quantize(java.math.BigInteger integerValue, Precision precision)
          Return a new FixPoint object based on the given BigInteger value and Precision constraint.
 
Methods inherited from class ptolemy.math.Overflow
_addOverflow, clone, equals, forName, getName, hashCode, isOutOfRange, isOverflow, isUnderflow, nameIterator, quantizeGrow, quantizeMinimum, quantizeModulo, quantizeSaturate, quantizeToZero, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Overflow.Saturate

private Overflow.Saturate()
Method Detail

minusInfinity

public java.math.BigInteger minusInfinity(Quantization quant)
Description copied from class: Overflow
Return the value of minus infinity, or null if unrepresentable.

The saturation value is returned for the saturate and to_zero strategies for which infinity is quantizable. Null is returned for other strategies.

Overrides:
minusInfinity in class Overflow
Parameters:
quant - The quantization specification.
Returns:
The value if defined, null if not..

plusInfinity

public java.math.BigInteger plusInfinity(Quantization quant)
Description copied from class: Overflow
Return the value of plus infinity, or null if unrepresentable.

The saturation value is returned for the saturate and to_zero strategies for which infinity is quantizable. Null is returned for other strategies.

Overrides:
plusInfinity in class Overflow
Parameters:
quant - The quantization specification.
Returns:
The value if defined, null if not.

quantize

public FixPoint quantize(java.math.BigInteger integerValue,
                         Precision precision)
Description copied from class: Overflow
Return a new FixPoint object based on the given BigInteger value and Precision constraint. This method will return a valid FixPoint object that conforms to the given overflow strategy implemented by the extending class.

Specified by:
quantize in class Overflow
Parameters:
integerValue - The unbounded integer value.
precision - The Precision constraint of the quantization.
Returns:
A valid FixPoint value that conforms to the overflow strategy.