ch.panter.li.bi.asn.value
Class AsnIntegralNumberValueBase
java.lang.Object
ch.panter.li.bi.asn.AsnValueBase
ch.panter.li.bi.asn.value.AsnSimpleValueBase
ch.panter.li.bi.asn.value.AsnObjectValueBase
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
AsnIntegralNumberValueBase
AsnIntegralNumberValueBase(AsnType type)
AsnIntegralNumberValueBase
AsnIntegralNumberValueBase(AsnIntegralNumberValueBase copy)
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.