com.unitech.lib.tagcoder

## Class SGTIN

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

-     public class SGTIN
      extends Object

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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SGTIN(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.
    `String` | `getCompany()` Get Company number.
    `int` | `getCount()` Get count of GTIN
    `String` | `getEpc()` Get EPC.
    `int` | `getExtensionDigit()` Get Extension Digit
    `String` | `getGTIN14()` Get GTIN
    `String` | `getItemReference()` Get Item Reference
    `int` | `getPrefiex()` Get GTIN prefix
    `String` | `getSerial()` Get Serial number
    `static String` | `strZero(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(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 String getEpc()

      Get EPC.
      Returns:
        A string of EPC.

    - #### getCompany

          public String getCompany()

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

    - #### getItemReference

          public 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 String getGTIN14()

      Get GTIN
      Returns:
        A string of GTIN.

    - #### getSerial

          public 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 String strZero(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