Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| WebLogic Integration
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.wlxt.bintype
Class BintypePacked

    java.lang.Object
      |
      +--com.bea.wlxt.bintype.Bintype
            |
            +--com.bea.wlxt.bintype.BintypePacked

public class BintypePacked
extends Bintype

Author:
  Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.
See Also:
  Serialized Form

Field Summary
`protected byte[]` | `byteUnpack` Table to convert packed decimal into decimal.

Fields inherited from class com.bea.wlxt.bintype.Bintype
`codepageEBCDIC`

Constructor Summary
`BintypePacked(java.lang.String dataType)`

Method Summary
`protected byte[]` | `convertPacked(java.math.BigDecimal value, int bytes, int precision, int scale, byte sign, com.bea.wlxt.mfl.MFLField mflField)` Convert a BigDecimal to a packed decimal number.
`protected java.math.BigDecimal` | `convertPacked(byte[] value, int precision, int scale, com.bea.wlxt.mfl.MFLField mflField)` Convert a packed decimal number to a BigDecimal.
`boolean` | `isPacked(com.bea.wlxt.mfl.MFLField mflField)`
`boolean` | `isPacked(java.lang.String dataType)`
`java.lang.String` | `read(java.io.InputStream byteStream, com.bea.wlxt.mfl.MFLField mflField)`
`java.lang.String` | `toString()`
`void` | `write(BintypeOutputStream byteStream, com.bea.wlxt.mfl.MFLField mflField, java.lang.String value)`
`void` | `writePacked(java.io.OutputStream byteStream, java.math.BigDecimal value, int bytes, int precision, int scale, com.bea.wlxt.mfl.MFLField mflField)` Write a BigDecimal as a mainframe signed packed decimal number.
`void` | `writePackedUnsigned(java.io.OutputStream byteStream, java.math.BigDecimal value, int bytes, int precision, int scale, com.bea.wlxt.mfl.MFLField mflField)` Write a BigDecimal as a mainframe unsigned packed decimal number.

Methods inherited from class com.bea.wlxt.bintype.Bintype
`applyPadAndTrim, applyPadTrimAndTruncate, canBeDataDelimited, canBeDelimited, canBeDelimSeparator, canBeFieldType, canBeLenFieldType, canBePadded, canBePassLiteral, canBeTagFieldType, canBeTrimmed, canBeTruncated, canHaveDecimalPlaces, getBinaryBytes, getDescriptionText, getDisplayName, getTypeName, isCodepageOK, isCutoffRequired, isDateType, isFixedSize, isValueOK, makeString, readDataDelim, readDelimitedField, readLength, readTag, reverseBytes, writeLength, writeTag`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### byteUnpack

    protected byte[] byteUnpack

  Table to convert packed decimal into decimal.

Constructor Detail

### BintypePacked

    public BintypePacked(java.lang.String dataType)

Method Detail

### read

    public java.lang.String read(java.io.InputStream byteStream,
                                 com.bea.wlxt.mfl.MFLField mflField)
                          throws BintypeException

  Overrides:
    read in class Bintype

### convertPacked

    protected java.math.BigDecimal convertPacked(byte[] value,
                                                 int precision,
                                                 int scale,
                                                 com.bea.wlxt.mfl.MFLField mflField)
                                          throws BintypeException

  Convert a packed decimal number to a BigDecimal. This will produce a BigDecimal that contains the proper value for the mainframe packed packed date given in buf. The packed decimal paramters relate to COBOL picture strings as follows:

       999v99   5,2,0   Normal case, 5 digits, 2 digits to right of decimal
                        point, no scaling.
       vpp999   5,5,2   5 digits, 3 digits to right of decimal, 2 scale digits.
       999ppv   5,0,2   5 digits, 0 digits to right of decimal, 2 scale digits.

  Parameters:
    `buf` - The mainframe bytes to be converted.
    `precision` - The number of digits to the right of the decimal point.
    `scale` - The number of assumed zero digits.

### write

    public void write(BintypeOutputStream byteStream,
                      com.bea.wlxt.mfl.MFLField mflField,
                      java.lang.String value)
               throws BintypeException

  Overrides:
    write in class Bintype

### writePacked

    public void writePacked(java.io.OutputStream byteStream,
                            java.math.BigDecimal value,
                            int bytes,
                            int precision,
                            int scale,
                            com.bea.wlxt.mfl.MFLField mflField)
                     throws BintypeException

  Write a BigDecimal as a mainframe signed packed decimal number.

### writePackedUnsigned

    public void writePackedUnsigned(java.io.OutputStream byteStream,
                                    java.math.BigDecimal value,
                                    int bytes,
                                    int precision,
                                    int scale,
                                    com.bea.wlxt.mfl.MFLField mflField)
                             throws BintypeException

  Write a BigDecimal as a mainframe unsigned packed decimal number.

### convertPacked

    protected byte[] convertPacked(java.math.BigDecimal value,
                                   int bytes,
                                   int precision,
                                   int scale,
                                   byte sign,
                                   com.bea.wlxt.mfl.MFLField mflField)
                            throws BintypeException

  Convert a BigDecimal to a packed decimal number. This will produce a byte[] that contains the packed representation of the given BigDecimal. The packed decimal paramters relate to COBOL picture strings as follows:

       999v99   5,2,0   Normal case, 5 digits, 2 digits to right of decimal point, no scaling.
       vpp999   5,5,2   5 digits, 3 digits to right of decimal, 2 scale digits.
       999ppv   5,0,2   5 digits, 0 digits to right of decimal, 2 scale digits.

  Parameters:
    `value` - The value to be written.
    `bytes` - The number of bytes that the resulting byte array should be.
    `precision` - The number of digits to the right of the decimal point.
    `scale` - The number of assumed zero digits.
    `sign` - The sign nibble to place on the result.
  Throws:
    java.lang.ArithmeticException - If value will not fit into the specified packed number.

### isPacked

    public boolean isPacked(com.bea.wlxt.mfl.MFLField mflField)

### isPacked

    public boolean isPacked(java.lang.String dataType)

### toString

    public java.lang.String toString()

  Overrides:
    toString in class java.lang.Object

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| WebLogic Integration
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

WebLogic Integration (WLI)