|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpops.ale.codec.EpcCodec
public abstract class EpcCodec
Field Summary | |
---|---|
protected static byte[] |
boundaryLeftMasks
This look-up table gives the mask to use for getting from 1 up to 7 Most significant bits of a byte |
protected static byte[] |
boundaryRightMasks
This look-up table gives the mask to use for getting from 1 up to 7 Least significant bits of a byte |
protected static byte[] |
boundaryShifts
This look-up table gives the shift to use for getting 1 to 7 Most significant bits of a bytes |
protected static java.lang.String |
COMMON_HEADER
|
protected static boolean |
MSB_FIRST
|
protected static boolean |
MSB_LAST
|
static byte |
SGLN_96_HEADER
Header of an SGTLN96 |
static byte |
SGTIN_96_HEADER
Header values of an SGTIN_96. |
Constructor Summary | |
---|---|
EpcCodec()
|
Method Summary | |
---|---|
protected static void |
appendUri(java.lang.StringBuffer uri,
long data,
byte digits)
Utility for facilitating the construction of an URI. |
protected static int |
ByteArrayToInt(byte[] bytes,
boolean msbFirst)
General purpose utility for converting an array of 4 bytes to an integer. |
protected static long |
ByteArrayToLong(byte[] bytes,
boolean msbFirst)
General purpose utility for converting an array of 8 bytes to a long. |
protected static int |
byteToInt(byte data)
Safe byte to int conversion : without bit sign problem ;). |
protected static long |
byteToLong(byte data)
Safe byte to long conversion : without bit sign problem ;). |
protected static java.lang.String |
convertToRawDecUri(byte[] tagData)
|
protected static java.lang.String |
convertToRawHexUri(byte[] tagData)
|
static byte |
decodeHeader(byte[] tagData)
Validates and decodes header. |
protected static long |
extractLongField(byte[] bytes,
int from,
byte trailingBits,
int to,
byte leadingBits)
Extracts a long (64-bit max) value from an array of bytes. |
protected static long |
getCompanyPrefix(byte[] tagData,
byte M,
byte L)
Utility for decoding company prefix. |
static EncScheme |
getEncodingScheme(byte[] tagData)
Validates and decodes header. |
protected static byte |
getFilterValue(byte[] tagData)
Decode filter Value. |
protected static int |
getItemReference(byte[] tagData,
byte M,
byte N)
Utility for decoding company an item reference. |
protected static byte |
getPartition(byte[] tagData)
Decode Partition Number. |
abstract java.lang.String |
getPureUri()
|
protected static long |
getSerialNumber(byte[] tagData,
byte M,
byte N)
Utility for decoding company a Serial number. |
abstract java.lang.String |
getTagUri()
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte SGTIN_96_HEADER
public static final byte SGLN_96_HEADER
protected static final boolean MSB_FIRST
protected static final boolean MSB_LAST
protected static final java.lang.String COMMON_HEADER
protected static final byte[] boundaryLeftMasks
protected static final byte[] boundaryRightMasks
protected static final byte[] boundaryShifts
Constructor Detail |
---|
public EpcCodec()
Method Detail |
---|
public static byte decodeHeader(byte[] tagData)
tagData
- tag data bytes.
public static EncScheme getEncodingScheme(byte[] tagData)
tagData
- tag data bytes.
protected static byte getFilterValue(byte[] tagData)
tagData
- tag data bytes.
protected static byte getPartition(byte[] tagData)
tagData
- tag data bytes.
protected static long getCompanyPrefix(byte[] tagData, byte M, byte L)
tagData
- tag data bytes.M
- Bits of company prefix.L
- Digits of company prefix.
protected static int getItemReference(byte[] tagData, byte M, byte N)
tagData
- tag data bytes.M
- Bits of company prefix.N
- Bits of item reference
protected static long getSerialNumber(byte[] tagData, byte M, byte N)
tagData
- tag data bytes.M
- Bits of company prefix.N
- Bits of item reference
protected static long extractLongField(byte[] bytes, int from, byte trailingBits, int to, byte leadingBits)
bytes
- array of bytes containing datafrom
- index of the 'first' byte
to usetrailingBits
- number of most significant bits to take. Range : 1..8.to
- index of the 'last' byte
to useleadingBits
- number of least significant bits to take in 'last' byte. Range : 1..8.
protected static int ByteArrayToInt(byte[] bytes, boolean msbFirst)
protected static long ByteArrayToLong(byte[] bytes, boolean msbFirst)
protected static long byteToLong(byte data)
protected static int byteToInt(byte data)
protected static void appendUri(java.lang.StringBuffer uri, long data, byte digits)
uri
- String buffer to completedata
- data to appenddigits
- maximum digits for data
java.lang.IllegalArgumentException
- if data is greater than 10^digitsprotected static java.lang.String convertToRawDecUri(byte[] tagData)
protected static java.lang.String convertToRawHexUri(byte[] tagData)
public abstract java.lang.String getPureUri()
public abstract java.lang.String getTagUri()
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |