ca.uhn.hl7v2.parser
Class FastParser.StructRef

java.lang.Object
  extended by ca.uhn.hl7v2.parser.FastParser.StructRef
Direct Known Subclasses:
FastParser.RootRef
Enclosing class:
FastParser

public static class FastParser.StructRef
extends java.lang.Object

A pointer to a distinct segment or group position in a message.

Version:
$Revision: 1.3 $ updated on $Date: 2009/10/03 15:25:46 $ by $Author: jamesagnew $
Author:
Bryan Tripp

Constructor Summary
FastParser.StructRef(FastParser.StructRef theParent, java.lang.String theRelativePath, boolean isSegment, int[] theFields)
           
 
Method Summary
 java.lang.String getChildName()
           
 int[] getFields()
           
 java.lang.String getFullPath()
           
 java.lang.String getRelativePath()
           
 FastParser.StructRef getSuccessor(java.lang.String theName)
           
 boolean isSegment()
           
 void reset()
          Resets the StructRef to its starting state, before its first iteration, and resets its children as well.
 void setSuccessor(java.lang.String theName, FastParser.StructRef theSuccessor)
          Indicates an immediately subsequent structure in parsing order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastParser.StructRef

public FastParser.StructRef(FastParser.StructRef theParent,
                            java.lang.String theRelativePath,
                            boolean isSegment,
                            int[] theFields)
Parameters:
theParent - a StructRef for the parent Group of the referenced Structure
theRelativePath - the relative (from the parent) Terser path to the referenced structure. If the structure repeats, the rep number should be replaced with "*" (it will be incremented as needed).
isSegment - true iff the referenced Structure is a Segment (rather than a Group)
theFields - a list of fields to be parsed for this segment (null or empty for groups)
Method Detail

setSuccessor

public void setSuccessor(java.lang.String theName,
                         FastParser.StructRef theSuccessor)
Indicates an immediately subsequent structure in parsing order. A Structure in a list should point to the next Structure in the list. A Structure that repeats should point to itself. A Structure at the end of a repeating Group should point to the Group. A Group should point to its first child.

Parameters:
theName - name of the next Segment in this direction (ie if the next structure is a group, not that one)
theSuccessor - the immediately next StructRef in that direction

getFullPath

public java.lang.String getFullPath()
Returns:
full Terser path, including parent and repetition information.

getRelativePath

public java.lang.String getRelativePath()
Returns:
relative Terser path as defined in constructor

getSuccessor

public FastParser.StructRef getSuccessor(java.lang.String theName)
Parameters:
theName - name of a successor in parse order, as set in setSuccessor()
Returns:
the StructRef under that name

getChildName

public java.lang.String getChildName()
Returns:
name of first successor, if available and if this is not a segment reference, otherwise null

isSegment

public boolean isSegment()
Returns:
true iff referenced Structure is a Segment

reset

public void reset()
Resets the StructRef to its starting state, before its first iteration, and resets its children as well.


getFields

public int[] getFields()
Returns:
an ordered list of fields to be parsed for this segment (empty if not a segment)


Copyright © 2001-2011 University Health Network. All Rights Reserved.