Open Business Objects for EDI
v3.6.0

com.americancoders.edi
Class FunctionalGroup

java.lang.Object
  |
  +--com.americancoders.edi.SegmentContainer
        |
        +--com.americancoders.edi.FunctionalGroup
All Implemented Interfaces:
java.io.Externalizable, IContainedObject, IIdentifier, ISegmentContainer, java.io.Serializable
Direct Known Subclasses:
ACHFunctionalGroup, EDIFactFunctionalGroup, TradacomsFunctionalGroup, X12FunctionalGroup

public abstract class FunctionalGroup
extends SegmentContainer
implements java.io.Externalizable, IContainedObject, ISegmentContainer

class for container Functional_Group

See Also:
Serialized Form

Field Summary
protected  com.americancoders.edi.TemplateFunctionalGroup myTemplate
           
protected  com.americancoders.edi.IContainedObject parent
           
protected  java.util.Vector transactionSets
           
 
Fields inherited from class com.americancoders.edi.SegmentContainer
container, dupSegment, myTemplateContainer
 
Constructor Summary
FunctionalGroup()
           
FunctionalGroup(com.americancoders.edi.TemplateFunctionalGroup inTFG, com.americancoders.edi.IContainedObject inParent, java.lang.String inHeaderID, java.lang.String inTrailerID)
          instantiates a functional group
 
Method Summary
 void addTransactionSet(com.americancoders.edi.TransactionSet inTransactionSet)
          add a transaction set to the vector (container)
 java.lang.String getFormattedText(int format)
          returns the EDI (EDIFact) formatted document in a String
 com.americancoders.edi.Segment getHeader()
          helper routine to get header segment
 java.lang.String getID()
          returns the ID which is "envelope".
 com.americancoders.edi.IContainedObject getParent()
          gets parent attribute
 com.americancoders.edi.TemplateSegment getTemplateSegment(java.lang.String inID)
          method of SegmentContainer interface
Functional Group's segments built from instance methods so we return a null and hope the call can figure it out
 com.americancoders.edi.Segment getTrailer()
          helper routine to get trailer segment
 com.americancoders.edi.TransactionSet getTransactionSet(int pos)
          get a transaction set from the vector
can throw runtime exception array out of bounds
 int getTransactionSetCount()
          get transaction set count
 java.util.Vector getTransactionSets()
          get the transaction set vector
 java.lang.String getXMLTag()
          gets the xml tag
 void readExternal(java.io.ObjectInput in)
          used by externalize methods
abstract  void setCountInTrailer()
          set the Transaction Count in the trailer object
 void setHeaderId(java.lang.String headerId)
           
 void setParent(com.americancoders.edi.IContainedObject inParent)
          sets parent attribute
 void setTrailerId(java.lang.String trailerId)
           
 java.lang.String toString()
          the toString method
 int trim()
          removes unused Segments and return the number of subsegments in container
 void validate()
          validates
 void validate(com.americancoders.edi.DocumentErrors inDErr)
          validates
doesn't throw exception but placess error message in DocumentErrors object
 void writeExternal(java.io.ObjectOutput out)
          used by externalize methods
 void writeFormattedText(java.io.Writer inWriter, int format)
          like getFormattedText; writes to a Writer object instead of building a string.
 
Methods inherited from class com.americancoders.edi.SegmentContainer
addSegment, addSegment, addSegment, addSegmentToVector, createSegment, createSegment, createSegmentByIDAndName, defineContainer, equivalentSegments, getContainerSize, getSegment, getSegment, getSegment, getSegment, getSegment, getSegment, getSegmentByDataElementValue, getSegmentCount, getSegmentCount, isNull, isSegment, isSegment, isVector, parse, removeSegment, removeSegment, removeSegment, removeSegment, resetToFirstEquivalentSegment, setSegmentAt, setSegmentAt, whyNotUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.americancoders.edi.ISegmentContainer
addSegment, createSegment, getSegment, getSegment, getSegmentCount, getTemplateSegmentContainer, removeSegment
 

Field Detail

transactionSets

protected java.util.Vector transactionSets

myTemplate

protected com.americancoders.edi.TemplateFunctionalGroup myTemplate

parent

protected com.americancoders.edi.IContainedObject parent
Constructor Detail

FunctionalGroup

public FunctionalGroup(com.americancoders.edi.TemplateFunctionalGroup inTFG,
                       com.americancoders.edi.IContainedObject inParent,
                       java.lang.String inHeaderID,
                       java.lang.String inTrailerID)
instantiates a functional group


FunctionalGroup

public FunctionalGroup()
Method Detail

setHeaderId

public void setHeaderId(java.lang.String headerId)

setTrailerId

public void setTrailerId(java.lang.String trailerId)

addTransactionSet

public void addTransactionSet(com.americancoders.edi.TransactionSet inTransactionSet)
                       throws OBOEException
add a transaction set to the vector (container)

Parameters:
inTransactionSet -
Throws:
used - for X12FunctionalGroup
OBOEException

getTransactionSetCount

public int getTransactionSetCount()
get transaction set count

Returns:
int

getTransactionSet

public com.americancoders.edi.TransactionSet getTransactionSet(int pos)
get a transaction set from the vector
can throw runtime exception array out of bounds

Parameters:
pos - position in vector
Returns:
TransactionSet

getTransactionSets

public java.util.Vector getTransactionSets()
get the transaction set vector

Returns:
Vector of transaction sets

getHeader

public com.americancoders.edi.Segment getHeader()
helper routine to get header segment

Returns:
segment

getTrailer

public com.americancoders.edi.Segment getTrailer()
helper routine to get trailer segment

Returns:
segment

getFormattedText

public java.lang.String getFormattedText(int format)
returns the EDI (EDIFact) formatted document in a String

Parameters:
format - int - format type see TransactionSet
Returns:
String the formatted document

writeFormattedText

public void writeFormattedText(java.io.Writer inWriter,
                               int format)
                        throws java.io.IOException
like getFormattedText; writes to a Writer object instead of building a string.

Parameters:
inWriter - writer - object written to
format - int - format type see TransactionSet
Throws:
OBOEException
java.io.IOException

validate

public void validate()
              throws OBOEException
validates

Throws:
OBOEException - indicates why envelope is invalid

validate

public void validate(com.americancoders.edi.DocumentErrors inDErr)
validates
doesn't throw exception but placess error message in DocumentErrors object


readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
used by externalize methods

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - ObjectInput stream
Throws:
java.io.IOException - - most likely class changed since written
java.lang.ClassNotFoundException - - only when dummy constructro not found

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
used by externalize methods

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - ObjectOutput stream
Throws:
java.io.IOException - java.io error

setCountInTrailer

public abstract void setCountInTrailer()
                                throws OBOEException
set the Transaction Count in the trailer object

OBOEException

getTemplateSegment

public com.americancoders.edi.TemplateSegment getTemplateSegment(java.lang.String inID)
method of SegmentContainer interface
Functional Group's segments built from instance methods so we return a null and hope the call can figure it out

Parameters:
inID - - template segment to get
Returns:
TemplateSegment - in this case a null

getID

public java.lang.String getID()
returns the ID which is "envelope".
required for SegmentContainer interface

Specified by:
getID in interface IIdentifier
Specified by:
getID in class SegmentContainer
Returns:
String

setParent

public void setParent(com.americancoders.edi.IContainedObject inParent)
sets parent attribute

Specified by:
setParent in interface IContainedObject
Parameters:
inParent - TemplateSegmentContainer

getParent

public com.americancoders.edi.IContainedObject getParent()
gets parent attribute

Specified by:
getParent in interface IContainedObject
Returns:
TemplateSegmentContainer

getXMLTag

public java.lang.String getXMLTag()
Description copied from interface: IIdentifier
gets the xml tag

Specified by:
getXMLTag in interface IIdentifier
Returns:
String

toString

public java.lang.String toString()
the toString method

Overrides:
toString in class java.lang.Object

trim

public int trim()
Description copied from class: SegmentContainer
removes unused Segments and return the number of subsegments in container

Overrides:
trim in class SegmentContainer
Returns:
int

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.