Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class NumericDE

java.lang.Object
  |
  +--com.americancoders.edi.DataElement
        |
        +--com.americancoders.edi.NumericDE
All Implemented Interfaces:
IContainedObject, IIdentifier

public class NumericDE
extends DataElement
implements IContainedObject

class for Data Elements defined as Numeric (Nx - where x is an integer representing number of decimal places)

OBOE - Open Business Objects for EDI

Part of the OBOE Basic Extended Package
An EDI and XML Translator Written In Java
Copyright 1998-2009 - American Coders, LTD - Raleigh NC USA
All rights reserved
American Coders, Ltd
P. O. Box 97462
Raleigh, NC 27624 USA
1-919-846-2014
http://www.americancoders.com

Version:
3.6.0
Author:
Joe McVerry - American Coders, Ltd.

Field Summary
protected  int cursor
           
protected static java.text.DecimalFormatSymbols dfs
           
protected  int fractionDigits
          stores fraction of digits
protected  java.lang.String[] value
           
 
Fields inherited from class com.americancoders.edi.DataElement
parent
 
Constructor Summary
NumericDE(com.americancoders.edi.TemplateDE inTDE, com.americancoders.edi.IContainedObject inParent)
          constructs from its template
 
Method Summary
 java.lang.String get()
          returns the value for the Data Element
 java.lang.String get(int inPos)
          returns the value for the Data Element
 int getDecimalPositions()
          gets the number of decimal positions
 java.lang.String getFixedLengthFormattedText()
           
 java.lang.String getFormattedText(int formatType)
          builds a formatted String of the object
 int getLength()
          gets the current length for the Data Element
static void main(java.lang.String[] args)
           
 void set(byte[] inValue)
          sets the fields contents, not formatted
 void set(java.lang.String inValue)
          sets the fields contents, cursor set to zero
 java.lang.String setFormatted(java.lang.String input)
          sets NumericDE object using an input string
use class set method to set values with assumed decimal
 void setNext(java.lang.String inValue)
          sets the fields contents by moving cursor, cursor will wrap around
 boolean validate(com.americancoders.edi.DocumentErrors inDErr)
          sets error in DocumentErrors
 java.lang.String validate(java.lang.String inText)
          returns error responses of contents
 
Methods inherited from class com.americancoders.edi.DataElement
getDescription, getID, getMaxLength, getMinLength, getName, getOccurs, getParent, getRequired, getSequence, getTemplate, getType, getXMLTag, isUsed, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.americancoders.edi.IContainedObject
getParent, setParent
 
Methods inherited from interface com.americancoders.edi.IIdentifier
getID, getXMLTag
 

Field Detail

value

protected java.lang.String[] value

cursor

protected int cursor

fractionDigits

protected int fractionDigits
stores fraction of digits


dfs

protected static final java.text.DecimalFormatSymbols dfs
Constructor Detail

NumericDE

public NumericDE(com.americancoders.edi.TemplateDE inTDE,
                 com.americancoders.edi.IContainedObject inParent)
constructs from its template

Parameters:
inTDE - TemplateDE
inParent - owning Object
Method Detail

set

public void set(java.lang.String inValue)
sets the fields contents, cursor set to zero

Specified by:
set in class DataElement
Parameters:
inValue - String contents
Throws:
OBOEException

setNext

public void setNext(java.lang.String inValue)
             throws OBOEException
sets the fields contents by moving cursor, cursor will wrap around

Specified by:
setNext in class DataElement
Parameters:
inValue - String contents
Throws:
OBOEException - inValue contains format characters if field defined with type of N#

set

public void set(byte[] inValue)
         throws OBOEException
sets the fields contents, not formatted

Specified by:
set in class DataElement
Parameters:
inValue - byte array, converted to string and set(String) is called
Throws:
OBOEException - inValue contains format characters if field defined with type of N#

getLength

public int getLength()
gets the current length for the Data Element

Specified by:
getLength in class DataElement
Returns:
int retuns length of set value, can have a null exception if value is not set.

get

public java.lang.String get()
returns the value for the Data Element

Specified by:
get in class DataElement
Returns:
String

get

public java.lang.String get(int inPos)
returns the value for the Data Element

Parameters:
inPos - int position in array
Returns:
String

getDecimalPositions

public int getDecimalPositions()
gets the number of decimal positions

Returns:
int number of decimal positions

getFormattedText

public java.lang.String getFormattedText(int formatType)
builds a formatted String of the object

Specified by:
getFormattedText in class DataElement
Parameters:
formatType - int x12, edifact...
Returns:
String of formatted text

setFormatted

public java.lang.String setFormatted(java.lang.String input)
                              throws OBOEException
sets NumericDE object using an input string
use class set method to set values with assumed decimal

Parameters:
input - set contents
Returns:
String input formatted
Throws:
OBOEException - invalid input

validate

public java.lang.String validate(java.lang.String inText)
returns error responses of contents

Specified by:
validate in class DataElement
Parameters:
inText - String text
Returns:
String - null if no error

validate

public boolean validate(com.americancoders.edi.DocumentErrors inDErr)
sets error in DocumentErrors

Specified by:
validate in class DataElement
Parameters:
inDErr - DocumentErrors object
Returns:
boolean false = error.

getFixedLengthFormattedText

public java.lang.String getFixedLengthFormattedText()
Overrides:
getFixedLengthFormattedText in class DataElement

main

public static void main(java.lang.String[] args)

Open Business Objects for EDI
v3.6.0


OBOE is a trademark or registered trademark of American Coders, Ltd. in the US and other countries.
Copyright 1999-2004 American Coders, Ltd.
POB 97462
Raleigh NC 27624 USA
All Rights Reserved.