com.unitech.lib.tagcoder

## Class SGTIN

- java.lang.Object
- - com.unitech.lib.tagcoder.SGTIN

-     public class SGTIN
      extends java.lang.Object

  The SGTIN class is a class that convert EPC to SGTIN format.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SGTIN(java.lang.String epc)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `checkLength(int epc_length)` Check if the EPC length matches the SGTIN-96 or SGTIN-198 format.
    `java.lang.String` | `getCompany()` Get Company number.
    `int` | `getCount()` Get count of GTIN
    `java.lang.String` | `getEpc()` Get EPC.
    `int` | `getExtensionDigit()` Get Extension Digit
    `java.lang.String` | `getGTIN14()` Get GTIN
    `java.lang.String` | `getItemReference()` Get Item Reference
    `int` | `getPrefiex()` Get GTIN prefix
    `java.lang.String` | `getSerial()` Get Serial number
    `static java.lang.String` | `strZero(java.lang.String input, int length)` Padding a string with zeroes
    `void` | `updateCount()` Update count of GTIN

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

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

- - ### Constructor Detail

    - #### SGTIN

          public SGTIN(java.lang.String epc)

  - ### Method Detail

    - #### checkLength

          public boolean checkLength(int epc_length)

      Check if the EPC length matches the SGTIN-96 or SGTIN-198 format.
      Returns:
        Returns true if a match is found; otherwise, false.

    - #### getEpc

          public java.lang.String getEpc()

      Get EPC.
      Returns:
        A string of EPC.

    - #### getCompany

          public java.lang.String getCompany()

      Get Company number.
      Returns:
        A string of Company number.

    - #### getItemReference

          public java.lang.String getItemReference()

      Get Item Reference
      Returns:
        A string of Item Reference.

    - #### getExtensionDigit

          public int getExtensionDigit()

      Get Extension Digit
      Returns:
        A integer of Extension Digit.

    - #### getGTIN14

          public java.lang.String getGTIN14()

      Get GTIN
      Returns:
        A string of GTIN.

    - #### getSerial

          public java.lang.String getSerial()

      Get Serial number
      Returns:
        A string of Serial number.

    - #### getPrefiex

          public int getPrefiex()

      Get GTIN prefix
      Returns:
        A integer of GTIN prefix.

    - #### updateCount

          public void updateCount()

      Update count of GTIN

    - #### getCount

          public int getCount()

      Get count of GTIN
      Returns:
        A integer of GTIN count.

    - #### strZero

          public static java.lang.String strZero(java.lang.String input,
                                                 int length)

      Padding a string with zeroes
      Parameters:
        `input` - A string of original data
        `length` - A integer of conversion result's length
      Returns:
        A string of conversion result