cdac.medinfo.sdk.hl7282.baselibs.messagedictionary

## Class Map

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.messagedictionary.Map

- All Implemented Interfaces:
    IMap

      public final class Map
      extends java.lang.Object
      implements IMap

  This class represents a map for Segment Items which represent structure of a Message. Index for map starts with 1.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Map()` Instantiates Message Map

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSegmentItem(ISegmentItem objSegmentItem)` Adds a Segment Item to Map.
    `void` | `addSegmentItem(ISegmentItem objSegmentItem, int index, EnumMapModifyMode enumModifyMode)` Adds a Segment Item to Map.
    `IMap` | `clone()` Generates clone of Map
    `IMap` | `getGroupMap(ISegmentKey enumGroupName)` Retrieves Map of specified Group name
    `boolean` | `getLock()` Retrieves current status of lock for IMessageMap
    `ISegmentItem` | `getSegmentItem(int index)` Retrieves SegmentItem from given index.
    `boolean` | `isFirstLevelMember(ISegmentKey enumSearchSegment)` Verifies whether Segment or Group is present at the first level of HL7 message structure or not.
    `boolean` | `isMember(ISegmentKey enumSearchSegment)` Verifies whether Segment or Group is member of HL7 Message or not according to Message Structure.
    `void` | `setLock(boolean bLock)` Sets lock on IMessageMap.
    `int` | `size()` This method returns the size of Message Map

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Map

          public Map()

      Instantiates Message Map

  - ### Method Detail

    - #### getSegmentItem

          public ISegmentItem getSegmentItem(int index)

      Retrieves SegmentItem from given index. Map index starts with 1.
      Specified by:
        `getSegmentItem` in interface `IMap`
      Parameters:
        `index` - value of index
      Returns:
        IPairedCollection segment structure list of this message

    - #### addSegmentItem

          public void addSegmentItem(ISegmentItem objSegmentItem)

      Adds a Segment Item to Map. Sequence number should start with 1 always and skipping of sequence is not allowed
      Specified by:
        `addSegmentItem` in interface `IMap`
      Parameters:
        `iSequence` - value of sequence number
        `objSegmentItem` - Specified Sequence Item

    - #### setLock

          public void setLock(boolean bLock)

      Sets lock on IMessageMap. If lock is set then new SegmentItem can not be added in IMessageMap
      Specified by:
        `setLock` in interface `IMap`
      Parameters:
        `bLock` - value of lock

    - #### getLock

          public boolean getLock()

      Retrieves current status of lock for IMessageMap
      Specified by:
        `getLock` in interface `IMap`
      Returns:
        boolean - status of lock

    - #### addSegmentItem

          public void addSegmentItem(ISegmentItem objSegmentItem,
                            int index,
                            EnumMapModifyMode enumModifyMode)

      Adds a Segment Item to Map. Sequence number should start with 1 always and skipping of sequence is not allowed
      Specified by:
        `addSegmentItem` in interface `IMap`
      Parameters:
        `iSequence` - value of sequence number
        `objSegmentItem` - Specified Sequence Item

    - #### size

          public int size()

      This method returns the size of Message Map
      Specified by:
        `size` in interface `IMap`
      Returns:
        int - number of SegmentItem available in Map

    - #### isMember

          public boolean isMember(ISegmentKey enumSearchSegment)

      Verifies whether Segment or Group is member of HL7 Message or not according to Message Structure.
      Specified by:
        `isMember` in interface `IMap`
      Parameters:
        `enumSearchSegment` - Object of ISegmentKey provides name of Segment or Group.
      Returns:
        True - if Given Segment or Group is part of HL7 message Structure else returns false.

    - #### isFirstLevelMember

          public boolean isFirstLevelMember(ISegmentKey enumSearchSegment)

      Verifies whether Segment or Group is present at the first level of HL7 message structure or not.
      Specified by:
        `isFirstLevelMember` in interface `IMap`
      Parameters:
        `enumSearchSegment` - Object of ISegmentKey provides name of Segment or Group.
      Returns:
        True - if Given Segment or Group is present at first level of HL7 message Structur else returns false.

    - #### clone

          public IMap clone()

      Generates clone of Map
      Specified by:
        `clone` in interface `IMap`
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        IMessageMap - instance of Map

    - #### getGroupMap

          public IMap getGroupMap(ISegmentKey enumGroupName)

      Retrieves Map of specified Group name
      Specified by:
        `getGroupMap` in interface `IMap`
      Parameters:
        `enumGroupName` - Object of ISegmentKey provides name of Group.
      Returns:
        IMessageMap Object of IMessageMap.