org.urhl7.igor
Class HL7RepeatingField

java.lang.Object
  extended by org.urhl7.igor.HL7RepeatingField
All Implemented Interfaces:
DelimitedStructure, GenericStructure

public class HL7RepeatingField
extends Object
implements GenericStructure, DelimitedStructure

The HL7RepeatingField is a data object that represents the one to many relationship between segments and fields.


Constructor Summary
HL7RepeatingField(char[] delims)
          Creates a HL7Field object that understands the specified delimiters.
HL7RepeatingField(HL7Segment parent)
          Creates a HL7Field object that understands the specified delimiters and parent.
 
Method Summary
 boolean addField(HL7Field field)
          Adds an HL7Field to the end of the underlying data structure
 void addField(int index, HL7Field field)
          Adds an HL7Field to the index position of the underlying data structure
 void changeDelims(char[] delims)
          Changes the delimiter set for this and all child objects
 char[] getDelims()
          Returns the delimiter set for this data object.
 HL7Field getField(int pos)
          Returns the HL7Field at the specified position in the underlying data structure
 List<HL7Field> getFields()
          Returns the underlying array list containing all HL7Fields for this structure
 HL7Segment getParent()
          Returns the HL7Segment that is the parent of this HL7RepeatingField
 String marshal()
          Returns a string representation of this and the underlying data structures
 boolean removeField(HL7Field field)
          Removed the specified field from the underlying data structure
 HL7Field removeField(int pos)
          Removes the HL7Field at the specified position
 HL7Field setField(int pos, HL7Field field)
          Replace the field at specified position with the provided field
 void setParent(HL7Segment parent)
          Sets the HL7Segment provided as the parent for this HL7RepeatingField
 void unmarshal(String data)
          Unmarshals an arbitrary String representation of a structure into this data structure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HL7RepeatingField

public HL7RepeatingField(char[] delims)
Creates a HL7Field object that understands the specified delimiters.

Parameters:
delims -

HL7RepeatingField

public HL7RepeatingField(HL7Segment parent)
Creates a HL7Field object that understands the specified delimiters and parent.

Parameters:
parent -
Method Detail

getFields

public List<HL7Field> getFields()
Returns the underlying array list containing all HL7Fields for this structure

Returns:
list of HL7Fields

getField

public HL7Field getField(int pos)
Returns the HL7Field at the specified position in the underlying data structure

Parameters:
pos - index of the field
Returns:
the HL7Field at the index

addField

public boolean addField(HL7Field field)
Adds an HL7Field to the end of the underlying data structure

Parameters:
field - the field to add
Returns:
success of the addition

addField

public void addField(int index,
                     HL7Field field)
Adds an HL7Field to the index position of the underlying data structure

Parameters:
index - the position to add to
field - the field to add

removeField

public HL7Field removeField(int pos)
Removes the HL7Field at the specified position

Parameters:
pos - the index to remove
Returns:
the removed field

removeField

public boolean removeField(HL7Field field)
Removed the specified field from the underlying data structure

Parameters:
field - the field to remove
Returns:
success of the removal

setField

public HL7Field setField(int pos,
                         HL7Field field)
Replace the field at specified position with the provided field

Parameters:
pos - the index to replace
field - the field to replace with
Returns:
the field that was replaced

unmarshal

public void unmarshal(String data)
Unmarshals an arbitrary String representation of a structure into this data structure

Specified by:
unmarshal in interface GenericStructure
Parameters:
data - a String representation of data

marshal

public String marshal()
Returns a string representation of this and the underlying data structures

Specified by:
marshal in interface GenericStructure
Returns:
a String representation of this structure

setParent

public void setParent(HL7Segment parent)
Sets the HL7Segment provided as the parent for this HL7RepeatingField

Parameters:
parent - the parent to set

getParent

public HL7Segment getParent()
Returns the HL7Segment that is the parent of this HL7RepeatingField

Returns:
the parent HL7Segment

getDelims

public char[] getDelims()
Returns the delimiter set for this data object.

Specified by:
getDelims in interface DelimitedStructure
Returns:
delimiter array

changeDelims

public void changeDelims(char[] delims)
Changes the delimiter set for this and all child objects

Specified by:
changeDelims in interface DelimitedStructure
Parameters:
delims - the delimiter set to use