public abstract class AbstractGroup extends AbstractStructure implements Group
log| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGroup(Group parent,
ModelClassFactory factory)
This constructor should be used by implementing classes that do not also
implement Message.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
add(Class<? extends Structure> c,
boolean required,
boolean repeating)
Adds a new Structure (group or segment) to this Group.
|
protected String |
add(Class<? extends Structure> c,
boolean required,
boolean repeating,
int index)
Adds a new Structure (group or segment) to this Group.
|
String |
addNonstandardSegment(String name)
Expands the group definition to include a segment that is not defined by
HL7 to be part of this group (eg an unregistered Z segment).
|
String |
addNonstandardSegment(String theName,
int theIndex)
Expands the group definition to include a segment that is not
defined by HL7 to be part of this group (eg an unregistered Z segment).
|
void |
clear()
Clears all data from this structure.
|
int |
currentReps(String name)
Returns the number of existing repetitions of the named structure.
|
Structure |
get(String name)
Returns the named structure.
|
Structure |
get(String name,
int rep)
Returns a particular repetition of the named Structure.
|
Structure[] |
getAll(String name)
Returns an array of Structure objects by name.
|
protected <T extends Structure> |
getAllAsList(String name,
Class<T> theType)
Returns a list containing all existing repetitions of the structure
identified by name
|
Class<? extends Structure> |
getClass(String name)
Returns the Class of the Structure at the given name index.
|
int |
getFieldNumForName(String name)
Given a child structure name, returns the child index (which is 1-indexed, meaning
that the first child is at index 1
|
ModelClassFactory |
getModelClassFactory()
Returns the
ModelClassFactory associated with this structure |
String |
getName()
Returns the class name (excluding package).
|
String[] |
getNames()
Returns an ordered array of the names of the Structures in this Group.
|
Set<String> |
getNonStandardNames()
Returns a Set containing the names of all non-standard structures
which have been added to this structure
|
protected int |
getReps(String name) |
protected <T extends Structure> |
getTyped(String name,
Class<T> type) |
protected <T extends Structure> |
getTyped(String name,
int rep,
Class<T> type) |
protected String |
insert(Class<? extends Structure> c,
boolean required,
boolean repeating,
int index,
String name)
Inserts the given structure into this group, at the indicated index
number.
|
Structure |
insertRepetition(String name,
int index)
Inserts a repetition of a given Structure into repetitions of that
structure by name.
|
protected void |
insertRepetition(String name,
Structure structure,
int index)
Inserts a repetition of a given Structure into repetitions of that
structure by name.
|
boolean |
isGroup(String name)
Returns true if the named structure is a group
|
boolean |
isRepeating(String name)
Returns true if the named structure is required.
|
boolean |
isRequired(String name)
Returns true if the named structure is required.
|
Structure |
removeRepetition(String name,
int index)
Removes a repetition of a given Structure objects by name.
|
protected Structure |
tryToInstantiateStructure(Class<? extends Structure> c,
String name)
Attempts to create an instance of the given class and return it as a
Structure.
|
getMessage, getParentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMessage, getParentprotected AbstractGroup(Group parent, ModelClassFactory factory)
parent - the group to which this Group belongs.factory - the factory for classes of segments, groups, and datatypes
under this grouppublic Structure get(String name) throws HL7Exception
get in interface GroupHL7Exception - if the named Structure is not part of this Group.public Structure get(String name, int rep) throws HL7Exception
get in interface GroupHL7Exception - if the named Structure is not part of this group, if the
structure is not repeatable and the given rep is > 0, or if
the given repetition number is more than one greater than the
existing number of repetitions.public String addNonstandardSegment(String name) throws HL7Exception
addNonstandardSegment in interface GroupHL7Exceptionpublic String addNonstandardSegment(String theName, int theIndex) throws HL7Exception
GroupaddNonstandardSegment in interface GroupHL7Exceptionpublic Set<String> getNonStandardNames()
public String[] getNames()
get(name).protected String add(Class<? extends Structure> c, boolean required, boolean repeating) throws HL7Exception
HL7Exceptionprotected String add(Class<? extends Structure> c, boolean required, boolean repeating, int index) throws HL7Exception
HL7Exceptionprotected Structure tryToInstantiateStructure(Class<? extends Structure> c, String name) throws HL7Exception
c - the Structure implementing classname - an optional name of the structure (used by Generic structures;
may be null)HL7Exceptionpublic boolean isGroup(String name) throws HL7Exception
isGroup in interface GroupHL7Exceptionpublic boolean isRequired(String name) throws HL7Exception
isRequired in interface GroupHL7Exceptionpublic boolean isRepeating(String name) throws HL7Exception
isRepeating in interface GroupHL7Exceptionpublic int currentReps(String name) throws HL7Exception
HL7Exceptionpublic Structure[] getAll(String name) throws HL7Exception
getAll in interface GroupHL7Exception - if the named Structure is not part of this Group.protected <T extends Structure> List<T> getAllAsList(String name, Class<T> theType) throws HL7Exception
HL7Exception - if the named Structure is not part of this Group.public Structure removeRepetition(String name, int index) throws HL7Exception
HL7Exception - if the named Structure is not part of this Group.protected void insertRepetition(String name, Structure structure, int index) throws HL7Exception
HL7Exception - if the named Structure is not part of this Group.public Structure insertRepetition(String name, int index) throws HL7Exception
HL7Exception - if the named Structure is not part of this Group.public int getFieldNumForName(String name) throws HL7Exception
HL7Exceptionpublic Class<? extends Structure> getClass(String name)
public String getName()
getName in interface StructureStructure.getName()protected String insert(Class<? extends Structure> c, boolean required, boolean repeating, int index, String name) throws HL7Exception
HL7Exceptionpublic void clear()
public final ModelClassFactory getModelClassFactory()
ModelClassFactory associated with this structureCopyright © 2001-2012 University Health Network. All Rights Reserved.