com.microfocus.cobol.lang.internal
Class CobolNumeric

java.lang.Object
  extended bycom.microfocus.cobol.lang.internal.CobolBytes
      extended bycom.microfocus.cobol.lang.internal.CobolField
          extended bycom.microfocus.cobol.lang.internal.CobolNumeric

public class CobolNumeric
extends CobolField


Field Summary
 
Fields inherited from class com.microfocus.cobol.lang.internal.CobolField
descriptor, F_BWZ, F_DBCS, F_EBCDIC, F_IBMCOMP, F_NONE, F_TRUNC, occurs, S_LEADING_INCLUDED, S_LEADING_SEPARATE, S_SIGNED_DEFAULT, S_TRAILING_INCLUDED, S_TRAILING_SEPARATE, S_UNSIGNED, T_ALPHANUMERIC, T_BCD, T_BINARY, T_DISPLAY, T_EDITED_ALPHANUMERIC, T_EDITED_DISPLAY, T_EDITED_FLOAT, T_FLOAT, T_PORTABLE_BINARY, T_UBCD
 
Fields inherited from class com.microfocus.cobol.lang.internal.CobolBytes
length, offset, record
 
Constructor Summary
CobolNumeric(CobolRecord record, int id, int offset, int length, int type, int flags, int sign, int digits, int alignment)
          Creates a new Cobol numeric data item.
CobolNumeric(CobolRecord record, int id, int offset, int length, int occurs, int type, int flags, int sign, int digits, int alignment)
          Creates a new Cobol numeric data item.
CobolNumeric(CobolRecord record, int id, int offset, int length, int occurs, int flags, String picture)
          Creates a new Cobol numeric-edited data item.
CobolNumeric(CobolRecord record, int id, int offset, int length, int flags, String picture)
          Creates a new Cobol numeric-edited data item.
 
Method Summary
 BigDecimal getBigDecimal()
          Returns the value of this CobolNumeric as a BigDecimal
 BigInteger getBigInteger()
          Returns the value of this CobolNumeric as a BigInteger
 byte getByteValue()
          Returns the value of this CobolNumeric as a byte
 double getDoubleValue()
          Returns the value of this CobolNumeric as a double
 float getFloatValue()
          Returns the value of this CobolNumeric as a float
 int getIntValue()
          Returns the value of this CobolNumeric as an int
 long getLongValue()
          Returns the value of this CobolNumeric as a long
 short getShortValue()
          Returns the value of this CobolNumeric as a short
 void setBigDecimal(BigDecimal value)
          Set the CobolNumeric to the specified BigDecimal value
 void setBigInteger(BigInteger value)
          Set the CobolNumeric to the specified BigInteger value
 void setByte(byte value)
          Set the CobolNumeric to the specified byte value
 void setDouble(double value)
          Set the CobolNumeric to the specified double value
 void setFloat(float value)
          Set the CobolNumeric to the specified float value
 void setInt(int value)
          Set the CobolNumeric to the specified int value
 void setLong(long value)
          Set the CobolNumeric to the specified long value
 void setShort(short value)
          Set the CobolNumeric to the specified short value
 void setString(String value)
          Set the CobolNumeric to the specified String value
 String toString()
          Convert the CobolNumeric to its String representation
 
Methods inherited from class com.microfocus.cobol.lang.internal.CobolBytes
getBytesValue, getRecord, setBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CobolNumeric

public CobolNumeric(CobolRecord record,
                    int id,
                    int offset,
                    int length,
                    int occurs,
                    int type,
                    int flags,
                    int sign,
                    int digits,
                    int alignment)
Creates a new Cobol numeric data item.

Parameters:
record - The record area containing the data item
id - An identifier for the data item that is unique within the record. Zero if none specified
offset - The offset of the data item within the record area. (0 = start)
length - The number of bytes in the data item. If the data item is an array then this is the number of bytes in each element of the array
occurs - The number of array entries
type - The type of the numeric data item. Valid types are T_DISPLAY, T_BINARY, T_PORTABLE_BINARY, T_BCD, T_UBCD, T_FLOAT
flags - Additional type information. Valid flags are F_NONE, F_EBCDIC, F_TRUNC, F_IBMCOMP
sign - The type of sign associated with the data item. Valid signs are S_UNSIGNED, S_SIGNED_DEFAULT, S_LEADING_INCLUDED, S_LEADING_SEPARATE, S_TRAILING_INCLUDED, S_TRAILING_SEPARATE
digits - The number of digits in the data item. If the data item is defined in terms of bytes (T_BINARY and T_PORTABLE_BINARY only), then this field should be zero
alignment - The alignment of the decimal point within the digits. An alignment of zero indicates the decimal point is at the rightmost end of the digits. A postive value indicates the number of positions to the left of the rightmost end of the digits. A negative value indicates the number of additonal positions to the right of the rightmost end of the digits
See Also:
ICobolType

CobolNumeric

public CobolNumeric(CobolRecord record,
                    int id,
                    int offset,
                    int length,
                    int type,
                    int flags,
                    int sign,
                    int digits,
                    int alignment)
Creates a new Cobol numeric data item.

Parameters:
record - The record area containing the data item
id - An identifier for the data item that is unique within the record. Zero if none specified
offset - The offset of the data item within the record area. (0 = start)
length - The number of bytes in the data item
type - The type of the numeric data item. Valid types are T_DISPLAY, T_BINARY, T_PORTABLE_BINARY, T_BCD, T_UBCD, T_FLOAT
flags - Additional type information. Valid flags are F_NONE, F_EBCDIC, F_TRUNC, F_IBMCOMP
sign - The type of sign associated with the data item. Valid signs are S_UNSIGNED, S_SIGNED_DEFAULT, S_LEADING_INCLUDED, S_LEADING_SEPARATE, S_TRAILING_INCLUDED, S_TRAILING_SEPARATE
digits - The number of digits in the data item. If the data item is defined in terms of bytes (T_BINARY and T_PORTABLE_BINARY only), then this field should be zero
alignment - The alignment of the decimal point within the digits. An alignment of zero indicates the decimal point is at the rightmost end of the digits. A postive value indicates the number of positions to the left of the rightmost end of the digits. A negative value indicates the number of additonal positions to the right of the rightmost end of the digits
See Also:
ICobolType

CobolNumeric

public CobolNumeric(CobolRecord record,
                    int id,
                    int offset,
                    int length,
                    int occurs,
                    int flags,
                    String picture)
Creates a new Cobol numeric-edited data item.

Parameters:
record - The record area containing the data item
id - An identifier for the data item that is unique within the record. Zero if none specified
offset - The offset of the data item within the record area. (0 = start)
length - The number of bytes in the data item
occurs - The number of array entries
flags - Additional type information. Valid flags are F_NONE, F_EBCDIC, F_TRUNC, F_IBMCOMP
picture - The Cobol picture clause of the numeric edited data item
See Also:
ICobolType

CobolNumeric

public CobolNumeric(CobolRecord record,
                    int id,
                    int offset,
                    int length,
                    int flags,
                    String picture)
Creates a new Cobol numeric-edited data item.

Parameters:
record - The record area containing the data item
id - An identifier for the data item that is unique within the record. Zero if none specified
offset - The offset of the data item within the record area. (0 = start)
length - The number of bytes in the data item.
flags - Additional type information. Valid flags are F_NONE, F_EBCDIC, F_TRUNC, F_IBMCOMP
picture - The Cobol picture clause of the numeric edited data item
See Also:
ICobolType
Method Detail

getBigDecimal

public BigDecimal getBigDecimal()
                         throws CobolRecordException
Returns the value of this CobolNumeric as a BigDecimal

Returns:
the numeric value represented by this object after conversion to type BigDecimal
Throws:
CobolRecordException - If an error occurs

getBigInteger

public BigInteger getBigInteger()
                         throws CobolRecordException
Returns the value of this CobolNumeric as a BigInteger

Returns:
the numeric value represented by this object after conversion to type BigInteger
Throws:
CobolRecordException - If an error occurs

getByteValue

public byte getByteValue()
                  throws CobolRecordException
Returns the value of this CobolNumeric as a byte

Returns:
the numeric value represented by this object after conversion to type byte
Throws:
CobolRecordException - If an error occurs

getShortValue

public short getShortValue()
                    throws CobolRecordException
Returns the value of this CobolNumeric as a short

Returns:
the numeric value represented by this object after conversion to type short
Throws:
CobolRecordException - If an error occurs

getIntValue

public int getIntValue()
                throws CobolRecordException
Returns the value of this CobolNumeric as an int

Returns:
the numeric value represented by this object after conversion to type int
Throws:
CobolRecordException - If an error occurs

getLongValue

public long getLongValue()
                  throws CobolRecordException
Returns the value of this CobolNumeric as a long

Returns:
the numeric value represented by this object after conversion to type long
Throws:
CobolRecordException - If an error occurs

getFloatValue

public float getFloatValue()
                    throws CobolRecordException
Returns the value of this CobolNumeric as a float

Returns:
the numeric value represented by this object after conversion to type float
Throws:
CobolRecordException - If an error occurs

getDoubleValue

public double getDoubleValue()
                      throws CobolRecordException
Returns the value of this CobolNumeric as a double

Returns:
the numeric value represented by this object after conversion to type double
Throws:
CobolRecordException - If an error occurs

setBigDecimal

public void setBigDecimal(BigDecimal value)
                   throws CobolRecordException
Set the CobolNumeric to the specified BigDecimal value

Parameters:
value - the BigDecimal to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setBigInteger

public void setBigInteger(BigInteger value)
                   throws CobolRecordException
Set the CobolNumeric to the specified BigInteger value

Parameters:
value - the BigInteger to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setByte

public void setByte(byte value)
             throws CobolRecordException
Set the CobolNumeric to the specified byte value

Parameters:
value - the byte to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setShort

public void setShort(short value)
              throws CobolRecordException
Set the CobolNumeric to the specified short value

Parameters:
value - the short to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setInt

public void setInt(int value)
            throws CobolRecordException
Set the CobolNumeric to the specified int value

Parameters:
value - the int to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setLong

public void setLong(long value)
             throws CobolRecordException
Set the CobolNumeric to the specified long value

Parameters:
value - the long to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setFloat

public void setFloat(float value)
              throws CobolRecordException
Set the CobolNumeric to the specified float value

Parameters:
value - the float to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setDouble

public void setDouble(double value)
               throws CobolRecordException
Set the CobolNumeric to the specified double value

Parameters:
value - the double to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

setString

public void setString(String value)
               throws CobolRecordException
Set the CobolNumeric to the specified String value

Specified by:
setString in class CobolField
Parameters:
value - the String to be assigned to this CobolNumeric
Throws:
CobolRecordException - If an error occurs

toString

public String toString()
Convert the CobolNumeric to its String representation

Specified by:
toString in class CobolField
Returns:
the String representing this CobolNumeric item



Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.