|
Open Business Objects for EDI v3.5.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.americancoders.edi.SegmentContainer
Segment Container
OBOE - Open Business Objects for EDI
Part of the OBOE Basic Extended Package
An EDI and XML Translator Written In Java
Copyright 1998-2007 - 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
| Field Summary | |
protected java.lang.Object[] |
container
storage for data elements |
protected boolean |
dupSegment
used by edi parser to test for duplicate segment entries |
TemplateSegmentContainer |
myTemplateContainer
this segments template |
| Constructor Summary | |
SegmentContainer()
|
|
| Method Summary | |
void |
addSegment(Segment inSegment)
add a segment to the array |
void |
addSegment(Segment inSegment,
int inPosition)
adds a Segment to the container by its predefined sequence |
protected void |
addSegment(Segment inSegment,
java.lang.Integer inI)
add a segment to the array |
void |
addSegmentToVector(Segment inSegment,
int inPosition)
adds a Segment to a vectorized segment in the container at a predefined sequence |
Segment |
createSegment(java.lang.String id)
creates a segment by ID |
Segment |
createSegment(java.lang.String id,
java.lang.String primaryIDValue)
creates a segment by ID and its primary id value Written for the HIPAA package, but you may find it useful |
void |
defineContainer()
simple routine to build the array based on the number of entries in the template segment vector |
protected boolean |
equivalentSegments(int i)
|
int |
getContainerSize()
returns the size of the segment array -1 if array is undefined |
abstract java.lang.String |
getID()
get the segment id |
Segment |
getSegment(int inPosition)
returns a Segment by its position |
Segment |
getSegment(int inPosition,
int inVectorPosition)
returns the Segment inside the subsegment Vector by its position |
Segment |
getSegment(java.lang.String ID)
returns a Segment by its ID |
Segment |
getSegment(java.lang.String ID,
int inVectorPosition)
returns a Segment by its ID and its position in the vector You must use this method call to get to floating segments |
Segment |
getSegment(java.lang.String ID,
java.lang.String primaryIDValue)
returns a Segment by its ID and its primaryIDValue Written for the HIPAA package, but you may find it useful |
Segment |
getSegment(java.lang.String ID,
java.lang.String primaryIDValue,
int inPosition)
returns one of a multiple set of Segments by its ID, its primaryIDValue and its relative position with relation to its primaryIDValue Written for the HIPAA package, but you may find it useful |
Segment |
getSegmentByDataElementValue(java.lang.String ID,
int inSequence,
java.lang.String inValue)
returns a Segment by its id and the contents of a data field Used for segments that repeat, useful with IDDE type fields. |
int |
getSegmentCount(int inPosition)
returns the number of elements in a vector position |
int |
getSegmentCount(java.lang.String ID)
returns the number of elements by id |
boolean |
isNull(int inPosition)
returns true if there is no object in container at requested position |
boolean |
isSegment(int inPosition)
returns true if object in container is a segment at requested position if false the subsegment is a vector or position specified is outside range of array |
boolean |
isSegment(int inPosition,
int inVectorPosition)
returns true if object in container is a Segment at requested position if false the subSegment is a vector or position specified is outside range of array |
boolean |
isVector(int inPosition)
returns true if object in container is a vector at requested position if true the subsegment is a segment or position specified is outside range of array |
boolean |
parse(ITokenizer TransactionTokenizedString)
parses the segment portion of an EDI Document, adds to segment vector |
void |
removeSegment(int inPosition)
removes a Segment from the container at a particular position can be used to remove all segments with same id at a vectorized position |
void |
removeSegment(int inPosition,
int inVectorPosition)
removes a Segment from the container at a particular position in the subsegment Vector |
void |
removeSegment(java.lang.String inID)
removes a Segment from the container by id, does this by setting array entry to null can be used to remove all segments with same id at a vectorized position |
void |
removeSegment(java.lang.String inID,
int inPosition)
removes a Segment from the container by its ID from the subsegment Vector |
protected int |
resetToFirstEquivalentSegment(int i)
|
void |
setSegmentAt(Segment inSegment,
int inPosition)
sets a Segment to the container at position in the array, if the Segment is part of the vectorized segment throw exception |
void |
setSegmentAt(Segment inSegment,
int inPosition,
int inVectorPosition)
sets a Segment to the vector at a position container |
int |
trim()
removes unused Segments and return the number of subsegments in container |
void |
whyNotUsed(Tokenizer et)
asks the container why it didn't use the current token |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.americancoders.edi.IContainedObject |
getDelimiter, getParent, setParent |
| Methods inherited from interface com.americancoders.edi.IIdentifier |
getXMLTag |
| Methods inherited from interface com.americancoders.edi.ISegmentContainer |
getTemplateSegmentContainer |
| Methods inherited from interface com.americancoders.edi.IDelimiterFetcher |
getDelimiter |
| Field Detail |
protected java.lang.Object[] container
public TemplateSegmentContainer myTemplateContainer
protected boolean dupSegment
| Constructor Detail |
public SegmentContainer()
| Method Detail |
public abstract java.lang.String getID()
getID in interface IIdentifier
public boolean parse(ITokenizer TransactionTokenizedString)
throws OBOEException
TransactionTokenizedString - incoming tokenized string
OBOEException - as thrown, can't process subsegment maybeprotected int resetToFirstEquivalentSegment(int i)
i - position where segment was placed
protected boolean equivalentSegments(int i)
i - position where segment was placed
public void whyNotUsed(Tokenizer et)
et - Tokenizer incoming tokenized stringpublic int getContainerSize()
public void defineContainer()
public void addSegment(Segment inSegment)
throws OBOEException
addSegment in interface ISegmentContainerinSegment - Segmemt to add to vector
OBOEException - segment doesn't belong
protected void addSegment(Segment inSegment,
java.lang.Integer inI)
throws OBOEException
inSegment - Segmemt to add to vector
OBOEException - segment doesn't belong
public void addSegment(Segment inSegment,
int inPosition)
throws OBOEException
inSegment - Segment to AddinPosition - int position to add at
OBOEException - Subsegment not defined at sequence
Subsegment sequence not defined
public void addSegmentToVector(Segment inSegment,
int inPosition)
throws OBOEException
inSegment - SegmentinPosition - int position
OBOEException - segment postion not vectorized
public void setSegmentAt(Segment inSegment,
int inPosition)
throws OBOEException
inSegment - SegmentinPosition - int position
OBOEException - out of range
Subsegment vectorized
Subsegment not defined at sequence
public void setSegmentAt(Segment inSegment,
int inPosition,
int inVectorPosition)
throws OBOEException
inSegment - SegmentinPosition - int position in arrayinVectorPosition - int position with vector at inPosition
OBOEException - out of range
Subsegment not vectorized
Subsegment not defined at sequence
public void removeSegment(java.lang.String inID)
throws OBOEException
removeSegment in interface ISegmentContainerinID - String id
OBOEException - unknown segment id
public void removeSegment(java.lang.String inID,
int inPosition)
throws OBOEException
inID - String IDinPosition - int position in array
OBOEException - Subsegment not vectorized
unknown segment id
public void removeSegment(int inPosition)
throws OBOEException
inPosition - int position in array
OBOEException - position number out of range
public void removeSegment(int inPosition,
int inVectorPosition)
throws OBOEException
inPosition - int position in arrayinVectorPosition - int position in Vector at inPosition in array
OBOEException - position number out of range
Subsegment not vectorized
Subsegment sequence not defined
public Segment getSegment(int inPosition)
throws OBOEException
inPosition - int position in array
OBOException - "No segment at this position" - it is a Vector of segments
OBOEException
public Segment getSegment(int inPosition,
int inVectorPosition)
throws OBOEException
inPosition - int position in arrayinVectorPosition - int position in Vector at inPosition in array
OBOEException - bad position specified, position is negative, larger than Vector or
object at position specified by first parameter is a segment.
public Segment getSegment(java.lang.String ID)
throws OBOEException
getSegment in interface ISegmentContainerID - String id of segment to get
OBOEException - "ID is unknown to segment "
public Segment getSegment(java.lang.String ID,
int inVectorPosition)
throws OBOEException
getSegment in interface ISegmentContainerID - String id of segment to getinVectorPosition - int position in Vector at position in array identified by id
OBOEException - Segment with ID not within a Vector.
public Segment getSegment(java.lang.String ID,
java.lang.String primaryIDValue)
throws OBOEException
ID - String id of segment to getprimaryIDValue - String - primary IDs are the values in an mandatory
IDDE field value list, any value in the IDList will find this segment
OBOEException - Segment with ID not within a Vector.
public Segment getSegment(java.lang.String ID,
java.lang.String primaryIDValue,
int inPosition)
throws OBOEException
ID - String id of segment to getprimaryIDValue - String - primary IDs are the values in an mandatoryinPosition - int - relative position of segment with relation to its primaryIDValue
offset by 0 withing
IDDE field value list, any value in the IDList will find this segment
OBOEException - Segment with ID not within a Vector.
public Segment getSegmentByDataElementValue(java.lang.String ID,
int inSequence,
java.lang.String inValue)
throws OBOEException
ID - String id of loopinSequence - int DataElement sequence number relative to 1inValue - String value to test
OBOEException - Segment with ID not within a Vector.public int getSegmentCount(int inPosition)
inPosition - int position in array
java.lang.ArrayOutOfBounds - is possible.public int getSegmentCount(java.lang.String ID)
getSegmentCount in interface ISegmentContainerID - String id to count
OBOEException - ID unknown.public boolean isSegment(int inPosition)
inPosition - int position inarray
public boolean isSegment(int inPosition,
int inVectorPosition)
inPosition - int position inarray
public boolean isVector(int inPosition)
inPosition - int position in array
public boolean isNull(int inPosition)
inPosition - int position in array
public Segment createSegment(java.lang.String id)
throws OBOEException
createSegment in interface ISegmentContainerid - String id of subsegment to create
OBOEException - unknown id
public Segment createSegment(java.lang.String id,
java.lang.String primaryIDValue)
throws OBOEException
id - String id of subsegment to createprimaryIDValue - String - primary IDs are the values in an mandatory
IDDE field value list, any value in the IDList will create this segment
OBOEException - unknown idpublic int trim()
|
Open Business Objects for EDI v3.5.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||