WebLogic Integration


com.bea.wlxt.bintype
Class BintypeZoned

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

public class BintypeZoned
extends Bintype

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

Field Summary
protected static byte[] byteUnzone
          Table to convert zoned decimal into decimal.
protected static java.util.Map typeInfo
           
 
Fields inherited from class com.bea.wlxt.bintype.Bintype
codepageEBCDIC
 
Constructor Summary
BintypeZoned(java.lang.String dataType)
           
 
Method Summary
protected  byte[] convertZoned(java.math.BigDecimal value, int length, int precision, int scale, char sign, com.bea.wlxt.mfl.MFLField mflField)
          Convert a BigDecimal to a zoned decimal number.
protected  java.math.BigDecimal convertZoned(byte[] value, int precision, int scale, com.bea.wlxt.mfl.MFLField mflField)
          Convert a zoned decimal number to a BigDecimal.
 boolean isZoned(com.bea.wlxt.mfl.MFLField mflField)
           
 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 writeUnsignedZoned(java.io.OutputStream byteStream, java.math.BigDecimal value, int length, int precision, int scale, com.bea.wlxt.mfl.MFLField mflField)
          Write a BigDecimal as a mainframe unsigned zoned decimal number.
 void writeZoned(java.io.OutputStream byteStream, java.math.BigDecimal value, int length, int precision, int scale, com.bea.wlxt.mfl.MFLField mflField)
          Write a BigDecimal as a mainframe signed zoned 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

byteUnzone

protected static byte[] byteUnzone
Table to convert zoned decimal into decimal.

typeInfo

protected static java.util.Map typeInfo
Constructor Detail

BintypeZoned

public BintypeZoned(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

convertZoned

protected java.math.BigDecimal convertZoned(byte[] value,
                                            int precision,
                                            int scale,
                                            com.bea.wlxt.mfl.MFLField mflField)
                                     throws BintypeException
Convert a zoned decimal number to a BigDecimal. This will produce a BigDecimal that contains the proper value for the mainframe zoned data given in buf. The zoned 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

writeZoned

public void writeZoned(java.io.OutputStream byteStream,
                       java.math.BigDecimal value,
                       int length,
                       int precision,
                       int scale,
                       com.bea.wlxt.mfl.MFLField mflField)
                throws BintypeException
Write a BigDecimal as a mainframe signed zoned decimal number.

writeUnsignedZoned

public void writeUnsignedZoned(java.io.OutputStream byteStream,
                               java.math.BigDecimal value,
                               int length,
                               int precision,
                               int scale,
                               com.bea.wlxt.mfl.MFLField mflField)
                        throws BintypeException
Write a BigDecimal as a mainframe unsigned zoned decimal number.

convertZoned

protected byte[] convertZoned(java.math.BigDecimal value,
                              int length,
                              int precision,
                              int scale,
                              char sign,
                              com.bea.wlxt.mfl.MFLField mflField)
                       throws BintypeException
Convert a BigDecimal to a zoned decimal number. This will produce a byte[] that contains the zoned representation of the given BigDecimal. The zoned 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.
length - The size of the returned byte array.
precision - The number of digits to the right of the decimal point.
scale - The number of assumed zero digits.
sign - The sign (+ or -) to place on the result.
Throws:
BintypeException - If value will not fit into the specified zoned number.

isZoned

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

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

WebLogic Integration

WebLogic Integration (WLI)