public class GTIN extends StandardNumber implements java.lang.Cloneable, java.lang.Comparable<GTIN>
Global Trade Item Number (GTIN).
GTIN describes a family of GS1 (EAN.UCC) global data structures that employ 14 digits and can be encoded into various types of data carriers.
Currently, GTIN is used exclusively within bar codes, but it could also be used in other data carriers such as radio frequency identification (RFID). The GTIN is only a term and does not impact any existing standards, nor does it place any additional requirements on scanning hardware.
For North American companies, the UPC is an existing form of the GTIN.
Since 2005, EAN International and American UCC merged to GS1 and also EAN and UPC is now named GTIN.
The EAN/UCC-13 code is now officially called GTIN-13 (Global Trade Identifier Number). Former 12-digit UPC codes can be converted into EAN/UCC-13 code by simply adding a preceeding zero.
As of January 1, 2007, the former ISBN numbers have been integrated into the EAN/UCC-13 code. For each old ISBN-10 code, there exists a proper translation into EAN/UCC-13 by adding "978" as prefix.
The family of data structures comprising GTIN include
GTIN-8 (EAN/UCC-8): this is an 8-digit number
GTIN-12 (UPC-A): this is a 12-digit number
GTIN-13 (EAN/UCC-13): this is a 13-digit number
GTIN-14 (EAN/UCC-14 or ITF-14): this is a 14-digit number
See GTIN info
type, value
Constructor and Description |
---|
GTIN() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a clone if the implementation is cloneable.
|
int |
compareTo(GTIN gtin) |
GTIN |
createChecksum(boolean createWithChecksum)
Indicate that a correct check sum should be computed.
|
boolean |
equals(java.lang.Object object) |
java.lang.String |
format()
Return a formatted value of this standard number
This is best for human-readable representation, but is
not necessarily a format for computation.
|
static StandardNumber |
getInstance(java.lang.Package thePackage,
java.lang.ClassLoader classLoader,
java.lang.String type) |
static StandardNumber |
getInstance(java.lang.String type) |
java.util.Collection<java.lang.String> |
getTypedVariants() |
int |
hashCode() |
boolean |
isValid()
Check this number for validity.
|
GTIN |
normalize()
Normalize the value by removing all unwanted characters or
replacing characters with the ones required for verification.
|
java.lang.String |
normalizedValue()
Return normalized value of this standard number.
|
GTIN |
reset() |
GTIN |
verify()
Verify the number.
|
set, type
public int compareTo(GTIN gtin)
compareTo
in interface java.lang.Comparable<GTIN>
public GTIN createChecksum(boolean createWithChecksum)
StandardNumber
Indicate that a correct check sum should be computed.
createChecksum
in class StandardNumber
createWithChecksum
- if checksum is includedpublic GTIN normalize()
StandardNumber
Normalize the value by removing all unwanted characters or replacing characters with the ones required for verification.
normalize
in class StandardNumber
public boolean isValid()
StandardNumber
Check this number for validity.
isValid
in class StandardNumber
public GTIN verify()
StandardNumber
Verify the number.
verify
in class StandardNumber
public java.lang.String normalizedValue()
StandardNumber
Return normalized value of this standard number. In most cases, this is also the canonical form of the standard number. This is a representation without unneccessary characters, useful for computation purposes, like comparing for equivalence.
normalizedValue
in class StandardNumber
public java.lang.String format()
StandardNumber
Return a formatted value of this standard number This is best for human-readable representation, but is not necessarily a format for computation.
format
in class StandardNumber
public GTIN reset()
reset
in class StandardNumber
public java.util.Collection<java.lang.String> getTypedVariants()
getTypedVariants
in class StandardNumber
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- if this is called on an
implementation that does not support `Cloneable`public static StandardNumber getInstance(java.lang.String type) throws NoSuchStandardNumberException
NoSuchStandardNumberException
public static StandardNumber getInstance(java.lang.Package thePackage, java.lang.ClassLoader classLoader, java.lang.String type) throws NoSuchStandardNumberException
NoSuchStandardNumberException