ch.panter.li.bi.asn.value
Class AsnIntegralNumberValueBase

java.lang.Object
  extended by ch.panter.li.bi.asn.AsnValueBase
      extended by ch.panter.li.bi.asn.value.AsnSimpleValueBase
          extended by ch.panter.li.bi.asn.value.AsnObjectValueBase
              extended by ch.panter.li.bi.asn.value.AsnIntegralNumberValueBase
All Implemented Interfaces:
IntegralValue, IntegralValueInfo, NumericalValueInfo, Validatable, AsnValue
Direct Known Subclasses:
AsnEnumerated, AsnInteger

public abstract class AsnIntegralNumberValueBase
extends AsnObjectValueBase
implements IntegralValue


Constructor Summary
AsnIntegralNumberValueBase(AsnIntegralNumberValueBase copy)
           
AsnIntegralNumberValueBase(AsnType type)
           
 
Method Summary
 void assign(IntegralValue other)
           
 Number getValue()
           
 int getValueAsInt()
          The value of this instance as a java int.
 boolean isNegative()
          Determines whether this instance has a 'negative' value (not including zero).
 boolean isPositive()
          Determines whether this instance has a 'positive' value (not including zero).
 boolean isValueAnInt()
          Determines whether the value of this tag can be represented in a java int.
 boolean isZero()
          Determines whether this instance has a 'zero' value.
 void setValue(BigInteger value)
           
 void setValue(Byte value)
           
 void setValue(Integer value)
           
 void setValue(IntegralValue value)
           
 void setValue(Long value)
           
 void setValue(Short value)
           
protected  void validateValueObject(Object value)
           
 
Methods inherited from class ch.panter.li.bi.asn.value.AsnObjectValueBase
computeHashCode, copyValueObject, getValueObject, isEqualTo, setValueObject, toString
 
Methods inherited from class ch.panter.li.bi.asn.AsnValueBase
checkTypeDerivedFrom, collectValidationInfo, equals, getTag, getType, hashCode, isValid, setTag, validate, validateStructure
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.panter.li.bi.asn.AsnValue
copyAsnValue
 

Constructor Detail

AsnIntegralNumberValueBase

AsnIntegralNumberValueBase(AsnType type)

AsnIntegralNumberValueBase

AsnIntegralNumberValueBase(AsnIntegralNumberValueBase copy)
Method Detail

getValue

public final Number getValue()
Specified by:
getValue in interface NumericalValueInfo

isZero

public final boolean isZero()
Description copied from interface: NumericalValueInfo
Determines whether this instance has a 'zero' value.

Specified by:
isZero in interface NumericalValueInfo
Returns:
true if the value is non-null and has the zero content of its respective class (Float, Double or BigDecimal).

isPositive

public final boolean isPositive()
Description copied from interface: NumericalValueInfo
Determines whether this instance has a 'positive' value (not including zero).

Specified by:
isPositive in interface NumericalValueInfo
Returns:
true if the value is non-null and has a strictly positive content of its respective class (Float, Double or BigDecimal).

isNegative

public final boolean isNegative()
Description copied from interface: NumericalValueInfo
Determines whether this instance has a 'negative' value (not including zero).

Specified by:
isNegative in interface NumericalValueInfo
Returns:
true if the value is non-null and has a strictly negative content of its respective class (Float, Double or BigDecimal).

isValueAnInt

public final boolean isValueAnInt()
Description copied from interface: IntegralValueInfo
Determines whether the value of this tag can be represented in a java int.

Specified by:
isValueAnInt in interface IntegralValueInfo
Returns:
true if it is safe to call getValueAsInt() without losing information, false if getValue() should be used instead.

getValueAsInt

public final int getValueAsInt()
Description copied from interface: IntegralValueInfo
The value of this instance as a java int. Should only be called if isValueAnInt() returned true.

Specified by:
getValueAsInt in interface IntegralValueInfo
Returns:
the value of this instance as a java int (possibly with lost information in case it doesn't fit into a java int!)

validateValueObject

protected final void validateValueObject(Object value)
Overrides:
validateValueObject in class AsnObjectValueBase

setValue

public final void setValue(Byte value)
Specified by:
setValue in interface IntegralValue

setValue

public final void setValue(Short value)
Specified by:
setValue in interface IntegralValue

setValue

public final void setValue(Integer value)
Specified by:
setValue in interface IntegralValue

setValue

public final void setValue(Long value)
Specified by:
setValue in interface IntegralValue

setValue

public final void setValue(BigInteger value)
Specified by:
setValue in interface IntegralValue

setValue

public final void setValue(IntegralValue value)
Specified by:
setValue in interface IntegralValue

assign

public void assign(IntegralValue other)
Specified by:
assign in interface IntegralValue


Copyright 2007-2007 SourceForge. All Rights Reserved.