cdac.medinfo.sdk.hl7282.baselibs

## Class UN

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.baselibs.PrimitiveDataType
  - - cdac.medinfo.sdk.hl7282.baselibs.UN

- All Implemented Interfaces:
    IDataType

      public class UN
      extends PrimitiveDataType

  The class is Extended from PrimitiveDataType. Used when data type is unknown.

  This class override the equal method, to check whether some other object is "equal to" this one.

  User can also create Data Type through `DataElementFactory`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UN()` Constructor for UN class.
    `UN(int iMinLength, int iMaxLength, java.lang.String strCLength)` Constructor for UN class which takes three argument and sets the value in the respective member variable.
    `UN(int iMinLength, int iMaxLength, java.lang.String strCLength, int iTableNo)` Constructor for UN class which takes four arguments and sets the value in the respective member variable.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object objObject)` This method checks the equality of Object.
    `int` | `read(java.lang.String strSegmentStream, IDelimiter objIDelimiter)` Read data from String and also it take care of repeated values of this DataType
    `boolean` | `validate()` This validate function validates the data value object.
    `int` | `write(IHL7Stream objIHL7Stream, IDelimiter objIDelimiter)` Writes the unknown data to the stream from the byte buffer This function writes the Data Value to the Stream

    - ### Methods inherited from class cdac.medinfo.sdk.hl7282.baselibs.PrimitiveDataType

      `copy, getDataTypeName, getICLength, getIMaxLength, getIMinLength, getLength, getValue, isPrimitive, setICLength, setIMaxLength, setIMinLength, setValue, toString`

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

      `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UN

          public UN()

      Constructor for UN class.

    - #### UN

          public UN(int iMinLength,
            int iMaxLength,
            java.lang.String strCLength)

      Constructor for UN class which takes three argument and sets the value in the respective member variable.
      Parameters:
        `iMinLength` - The Minimum length the DataType can have.
        `iMaxLength` - The Maximum length the DataType can have.
        `iCLength` - The Conformance length the DataType can have.

    - #### UN

          public UN(int iMinLength,
            int iMaxLength,
            java.lang.String strCLength,
            int iTableNo)

      Constructor for UN class which takes four arguments and sets the value in the respective member variable.
      Parameters:
        `iMinLength` - The Minimum length the DataType can have.
        `iMaxLength` - The Maximum length the DataType can have.
        `iCLength` - The Conformance length the DataType can have.
        `iTableNo` - The Table number to which the value for the component is specified.

  - ### Method Detail

    - #### read

          public int read(java.lang.String strSegmentStream,
                 IDelimiter objIDelimiter)
                   throws DelimiterMissingException,
                          InvalidDelimiterException,
                          InvalidDataTypeException,
                          java.io.IOException

      Read data from String and also it take care of repeated values of this DataType
      Specified by:
        `read` in interface `IDataType`
      Overrides:
        `read` in class `PrimitiveDataType`
      Parameters:
        `objIHL7Stream` - Object of HL7Stream
        `objIDelimiter` - object of class Delimiter
      Returns:
        integer - Number of bytes read. - Fail if data read is not valid.
      Throws:
        `DelimiterMissingException` - - if Delimiter is absent.
        `InvalidDelimiterException` - - if Delimiter is not valid
        `java.io.IOException` - - if IO Exception fails.
        `InvalidDataTypeException`

    - #### write

          public int write(IHL7Stream objIHL7Stream,
                  IDelimiter objIDelimiter)
                    throws DelimiterMissingException,
                           java.io.IOException

      Writes the unknown data to the stream from the byte buffer This function writes the Data Value to the Stream
      Specified by:
        `write` in interface `IDataType`
      Overrides:
        `write` in class `PrimitiveDataType`
      Parameters:
        `objIHL7Stream` - stream onto which the FD DataType is to serialized
        `objIDelimiter` - object of class Delimiter
      Returns:
        HL7_FUNCTION_SUCCESS -on successful write
      Throws:
        `DelimiterMissingException` - thrown when Delimiter is missing
        `java.io.IOException` - thrown when IO operation fails

    - #### validate

          public boolean validate()

      This validate function validates the data value object. This Validate method return true, because we can not understand what type of Data Type it contains (it is in String format).
      Specified by:
        `validate` in interface `IDataType`
      Overrides:
        `validate` in class `PrimitiveDataType`
      Returns:
        boolean - function status [Success/Failure].

    - #### equals

          public boolean equals(java.lang.Object objObject)

      This method checks the equality of Object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `objObject` - object of Object class.
      Returns:
        boolean - shows success or failure of the comparison.