Package ca.uhn.hl7v2.util
Class ReadOnlyMessageIterator
java.lang.Object
ca.uhn.hl7v2.util.ReadOnlyMessageIterator
Iterator though existing Stuctures in a message. No new repetitions or optional
structures are created during iteration (in contrast to MessageIterator).
Note that some structures are created during parsing, so the iteration may include
structures which were not present in the original encoded message. If these are
not desired they can be skipped using a FilterIterator. In fact to obtain an
iterator only over populated segments (not groups or empty segments) use the factory
method in this class.
- Version:
- $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:27 $ by $Author: jamesagnew $
- Author:
- Bryan Tripp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePopulatedSegmentIterator(Group theRoot) createPopulatedStructureIterator(Group theRoot, FilterIterator.Predicate<Structure> structureFilter) createPopulatedStructureIterator(Group theRoot, Class<? extends Structure> c) createPopulatedStructureIterator(Group theRoot, String structureName) booleanhasNext()next()voidremove()Not supported.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
ReadOnlyMessageIterator
- Parameters:
theRoot- root of depth first iteration, which starts with the first child
-
-
Method Details
-
createPopulatedSegmentIterator
- Parameters:
theRoot- root of depth first iteration, which starts with the first child- Returns:
- an iterator that skips groups and empty segments, returning only populated segments
-
createPopulatedStructureIterator
public static Iterator<Structure> createPopulatedStructureIterator(Group theRoot, Class<? extends Structure> c) - Parameters:
theRoot- root of depth first iteration, which starts with the first childc- structure class to look for- Returns:
- an iterator that skips all structures that do not match the parameter
-
createPopulatedStructureIterator
public static Iterator<Structure> createPopulatedStructureIterator(Group theRoot, String structureName) - Parameters:
theRoot- root of depth first iteration, which starts with the first childstructureName- structure name to look for- Returns:
- an iterator that skips all structures that do not match the parameter
-
createPopulatedStructureIterator
public static Iterator<Structure> createPopulatedStructureIterator(Group theRoot, FilterIterator.Predicate<Structure> structureFilter) - Parameters:
theRoot- root of depth first iteration, which starts with the first childstructureFilter- filter class- Returns:
- iterator that skips all structures that the filter does not accept
-
hasNext
-
next
-
remove
Not supported.
-