Segment¶
-
public class
Segment
implements Iterable<String>¶ This class represents an X12 segment.
Author: Prasad Balan
Constructors¶
Methods¶
addCompositeElement¶
addCompositeElement¶
addElement¶
-
public boolean
addElement
(String e)¶ Adds
java.lang.String
element to the segment. The element is added at the end of the elements in the current segment.Parameters: - e – the element to be added
Returns: boolean
addElement¶
-
public boolean
addElement
(int index, String e)¶ Inserts
java.lang.String
element to the segment at the specified positionParameters: - e – the element to be added
- index – a int.
Returns: boolean true if element matches the element at the index provided.
addElements¶
-
public boolean
addElements
(String s)¶ Adds
java.lang.String
with elements to the segment. The elements are added at the end of the elements in the current segment. e.g.addElements("ISA*ISA01*ISA02");
Parameters: - s – the element to add.
Returns: boolean
addElements¶
-
public boolean
addElements
(String... es) Adds
java.lang.String
elements to the segment. The elements are added at the end of the elements in the current segment. e.g.addElements("ISA", "ISA01", "ISA02");
Parameters: - es – elements to add.
Returns: boolean
getElement¶
-
public String
getElement
(int index)¶ Returns the
java.lang.String
element at the specified position.Parameters: - index – position
Returns: the element at the specified position.
getElements¶
-
public List<String>
getElements
()¶ Getter for the field
java.util.List
<java.lang.String
>Returns: List of elements
iterator¶
-
public Iterator<String>
iterator
()¶ Returns and
java.util.Iterator
<java.lang.String
> to the elements in the segment.Returns: java.util.Iterator
<java.lang.String
>
removeElement¶
setCompositeElement¶
setContext¶
setElement¶
-
public void
setElement
(int index, String s)¶ Replaces element at the specified position with the specified
java.lang.String
Parameters: - index – position of the element to be replaced
- s – new element with which to replace
toString¶
-
public String
toString
()¶ Returns the X12 representation of the segment.
Returns: a java.lang.String
object.
toString¶
toXML¶
-
public String
toXML
()¶ Returns the XML representation of the segment.
Returns: java.lang.String
XML representation of the segment.
toXML¶
-
public String
toXML
(boolean bRemoveTrailingEmptyElements)¶ Returns the XML representation of the segment.
Parameters: - bRemoveTrailingEmptyElements – a flag for whether or not empty trailing elements should be removed.
Returns: java.lang.String
XML representation of the segment.