ch.panter.li.bi.asn
Interface AsnIntegralNumber

All Superinterfaces:
Comparable<Object>
All Known Implementing Classes:
AsnIntegralNumberImpl

public interface AsnIntegralNumber
extends Comparable<Object>


Method Summary
 Number getValue()
          The value bits of this instance as an abstract number (Integer, Long, BigInteger).
 int getValueAsInt()
          The value of this instance as a java int.
 Number getValueLarge()
          The value bits of this instance as an abstract number (Long, BigInteger).
 boolean hasSameNumericalValue(Number compare)
          Determines whether this instances value matches the one of the given number.
 boolean isValueAnInt()
          Determines whether the value of this tag can be represented in a java int.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getValue

Number getValue()
The value bits of this instance as an abstract number (Integer, Long, BigInteger). Always safe to call, independent of the result of isValueAnInt().

Returns:
the value bits of this instance as an abstract number

hasSameNumericalValue

boolean hasSameNumericalValue(Number compare)
Determines whether this instances value matches the one of the given number.

Parameters:
compare - the value to compare our value to
Returns:
true if the two numbers represent the same numerical value, false otherwise

isValueAnInt

boolean isValueAnInt()
Determines whether the value of this tag can be represented in a java int. Depending on the result of this method one of the getValueAsInt() or getValueBits() must be used to access the value.

Returns:
true if it is safe to call getValueAsInt(), false if getValueBits() must be used.

getValueAsInt

int getValueAsInt()
The value of this instance as a java int. May only be called if isValueAnInt() returned true.

Returns:
the value of this instance as a java int
Throws:
IllegalStateException - in case the value is too large for a java int

getValueLarge

Number getValueLarge()
The value bits of this instance as an abstract number (Long, BigInteger). May only be called if isValueAnInt() returned false.

Returns:
the value bits of this instance as an abstract number
Throws:
IllegalStateException - in case the value fits into a java int


Copyright 2007-2007 SourceForge. All Rights Reserved.