Package org.dellroad.hl7
Class HL7SegmentList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<HL7Segment>
-
- org.dellroad.hl7.HL7SegmentList
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<HL7Segment>,Collection<HL7Segment>,List<HL7Segment>,RandomAccess
public final class HL7SegmentList extends ArrayList<HL7Segment>
List ofHL7Segmentobjects that requires there to always be an initial MSH segment. In particular, this class enforces the following constraints:- There must be at least one item in the list
- The first item in the list must be an
MSHSegment
IllegalStateExceptionbeing thrown.Note we do not enforce the other segments to be anything, not even non-null.
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description HL7SegmentList(MSHSegment msh)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()HL7Segmentremove(int index)booleanremove(Object obj)protected voidremoveRange(int fromIndex, int toIndex)HL7Segmentset(int index, HL7Segment segment)-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeAll, removeIf, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
HL7SegmentList
public HL7SegmentList(MSHSegment msh)
Constructor.- Parameters:
msh- MSH segment- Throws:
IllegalArgumentException- ifmshis null
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<HL7Segment>- Specified by:
clearin interfaceList<HL7Segment>- Overrides:
clearin classArrayList<HL7Segment>
-
remove
public HL7Segment remove(int index)
- Specified by:
removein interfaceList<HL7Segment>- Overrides:
removein classArrayList<HL7Segment>
-
remove
public boolean remove(Object obj)
- Specified by:
removein interfaceCollection<HL7Segment>- Specified by:
removein interfaceList<HL7Segment>- Overrides:
removein classArrayList<HL7Segment>
-
removeRange
protected void removeRange(int fromIndex, int toIndex)- Overrides:
removeRangein classArrayList<HL7Segment>
-
set
public HL7Segment set(int index, HL7Segment segment)
- Specified by:
setin interfaceList<HL7Segment>- Overrides:
setin classArrayList<HL7Segment>
-
-