Package org.jpos.iso
Class ISOAmount
- java.lang.Object
-
- org.jpos.iso.ISOComponent
-
- org.jpos.iso.ISOAmount
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
public class ISOAmount extends ISOComponent implements java.lang.Cloneable, java.io.Externalizable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dump(java.io.PrintStream p, java.lang.String indent)
boolean
equals(java.lang.Object o)
java.math.BigDecimal
getAmount()
java.lang.String
getAmountAsLegacyString()
java.lang.String
getAmountAsString()
int
getCurrencyCode()
java.lang.String
getCurrencyCodeAsString()
int
getFieldNumber()
java.lang.Object
getKey()
valid on Leafs only.int
getScale()
java.lang.String
getScaleAsString()
java.lang.Object
getValue()
valid on Leafs only.int
hashCode()
byte[]
pack()
void
readExternal(java.io.ObjectInput in)
void
setFieldNumber(int fieldNumber)
changes this Component field number
Use with care, this method does not change any reference held by a Composite.void
setValue(java.lang.Object obj)
java.lang.String
toString()
int
unpack(byte[] b)
void
unpack(java.io.InputStream in)
void
writeExternal(java.io.ObjectOutput out)
-
Methods inherited from class org.jpos.iso.ISOComponent
getBytes, getChildren, getComposite, getMaxField, pack, set, unset
-
-
-
-
Constructor Detail
-
ISOAmount
public ISOAmount()
-
ISOAmount
public ISOAmount(int fieldNumber)
-
ISOAmount
public ISOAmount(int fieldNumber, int currencyCode, java.math.BigDecimal amount) throws ISOException
- Throws:
ISOException
-
-
Method Detail
-
getKey
public java.lang.Object getKey()
Description copied from class:ISOComponent
valid on Leafs only. The value returned is used by ISOMsg as a key to this field.- Overrides:
getKey
in classISOComponent
- Returns:
- object representing the field number
-
getValue
public java.lang.Object getValue() throws ISOException
Description copied from class:ISOComponent
valid on Leafs only.- Overrides:
getValue
in classISOComponent
- Returns:
- object representing the field value
- Throws:
ISOException
-
setValue
public void setValue(java.lang.Object obj) throws ISOException
- Specified by:
setValue
in classISOComponent
- Throws:
ISOException
-
setFieldNumber
public void setFieldNumber(int fieldNumber)
Description copied from class:ISOComponent
changes this Component field number
Use with care, this method does not change any reference held by a Composite.- Specified by:
setFieldNumber
in classISOComponent
- Parameters:
fieldNumber
- new field number
-
getFieldNumber
public int getFieldNumber()
- Specified by:
getFieldNumber
in classISOComponent
-
getAmount
public java.math.BigDecimal getAmount()
-
getScale
public int getScale()
-
getScaleAsString
public java.lang.String getScaleAsString()
-
getCurrencyCode
public int getCurrencyCode()
-
getCurrencyCodeAsString
public java.lang.String getCurrencyCodeAsString() throws ISOException
- Throws:
ISOException
-
getAmountAsLegacyString
public java.lang.String getAmountAsLegacyString() throws ISOException
- Throws:
ISOException
-
getAmountAsString
public java.lang.String getAmountAsString() throws ISOException
- Throws:
ISOException
-
pack
public byte[] pack() throws ISOException
- Specified by:
pack
in classISOComponent
- Throws:
ISOException
-
unpack
public int unpack(byte[] b) throws ISOException
- Specified by:
unpack
in classISOComponent
- Throws:
ISOException
-
unpack
public void unpack(java.io.InputStream in) throws ISOException
- Specified by:
unpack
in classISOComponent
- Throws:
ISOException
-
dump
public void dump(java.io.PrintStream p, java.lang.String indent)
- Specified by:
dump
in classISOComponent
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-