-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
992 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
epctagcoder/src/main/java/org/epctagcoder/option/GSRN/GSRNFilterValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.epctagcoder.option.GSRN; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum GSRNFilterValue { | ||
ALL_OTHERS_0(0), | ||
RESERVED_1(1), | ||
RESERVED_2(2), | ||
RESERVED_3(3), | ||
RESERVED_4(4), | ||
RESERVED_5(5), | ||
RESERVED_6(6), | ||
RESERVED_7(7); | ||
|
||
private int value; | ||
|
||
private GSRNFilterValue(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<Integer, GSRNFilterValue> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (GSRNFilterValue rae : GSRNFilterValue.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static GSRNFilterValue forCode(int code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
} |
37 changes: 37 additions & 0 deletions
37
epctagcoder/src/main/java/org/epctagcoder/option/GSRN/GSRNHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.epctagcoder.option.GSRN; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum GSRNHeader { | ||
HEADER_00101101("00101101") { | ||
public Integer getTagSize() { | ||
return 96; | ||
} | ||
}; | ||
|
||
private String value; | ||
public abstract Integer getTagSize(); | ||
|
||
|
||
private GSRNHeader(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<String, GSRNHeader> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (GSRNHeader rae : GSRNHeader.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static GSRNHeader forCode(String code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
} |
36 changes: 36 additions & 0 deletions
36
epctagcoder/src/main/java/org/epctagcoder/option/GSRN/GSRNTagSize.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.epctagcoder.option.GSRN; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum GSRNTagSize { | ||
BITS_96(96) { | ||
public Integer getHeader() { | ||
return 45; | ||
} | ||
}; | ||
|
||
private int value; | ||
public abstract Integer getHeader(); | ||
|
||
private GSRNTagSize(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<Integer, GSRNTagSize> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (GSRNTagSize rae : GSRNTagSize.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static GSRNTagSize forCode(int code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...oder/src/main/java/org/epctagcoder/option/GSRN/partitionTable/GSRNPartitionTableList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.epctagcoder.option.GSRN.partitionTable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.epctagcoder.option.TableItem; | ||
|
||
|
||
public class GSRNPartitionTableList { | ||
static final private List<TableItem> list = new ArrayList<TableItem>(); | ||
|
||
static { | ||
list.add( new TableItem(0, 40, 12, 18, 5) ); | ||
list.add( new TableItem(1, 37, 11, 21, 6) ); | ||
list.add( new TableItem(2, 34, 10, 24, 7) ); | ||
list.add( new TableItem(3, 30, 9, 28, 8) ); | ||
list.add( new TableItem(4, 27, 8, 31, 9) ); | ||
list.add( new TableItem(5, 24, 7, 34, 10) ); | ||
list.add( new TableItem(6, 20, 6, 38, 11) ); | ||
} | ||
|
||
public GSRNPartitionTableList() { | ||
|
||
} | ||
|
||
public TableItem getPartitionByL(Integer index) { | ||
TableItem tableItem = null; | ||
for (TableItem item : list) { | ||
if (item.getL()==index) { | ||
tableItem = item; | ||
break; | ||
} | ||
} | ||
return tableItem; | ||
} | ||
|
||
public TableItem getPartitionByValue(Integer index) { | ||
TableItem tableItem = null; | ||
for (TableItem item : list) { | ||
if (item.getPartitionValue()==index) { | ||
tableItem = item; | ||
break; | ||
} | ||
} | ||
return tableItem; | ||
} | ||
|
||
|
||
} |
42 changes: 42 additions & 0 deletions
42
epctagcoder/src/main/java/org/epctagcoder/option/SSCC/SSCCExtensionDigit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.epctagcoder.option.SSCC; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum SSCCExtensionDigit { | ||
EXTENSION_0(0), | ||
EXTENSION_1(1), | ||
EXTENSION_2(2), | ||
EXTENSION_3(3), | ||
EXTENSION_4(4), | ||
EXTENSION_5(5), | ||
EXTENSION_6(6), | ||
EXTENSION_7(7), | ||
EXTENSION_8(8), | ||
EXTENSION_9(9); | ||
|
||
private int value; | ||
|
||
private SSCCExtensionDigit(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<Integer, SSCCExtensionDigit> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (SSCCExtensionDigit rae : SSCCExtensionDigit.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static SSCCExtensionDigit forCode(int code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
|
||
|
||
} |
38 changes: 38 additions & 0 deletions
38
epctagcoder/src/main/java/org/epctagcoder/option/SSCC/SSCCFilterValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.epctagcoder.option.SSCC; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum SSCCFilterValue { | ||
ALL_OTHERS_0(0), | ||
RESERVED_1(1), | ||
CASE_2(2), | ||
RESERVED_3(3), | ||
RESERVED_4(4), | ||
RESERVED_5(5), | ||
UNIT_LOAD_6(6), | ||
RESERVED_7(7); | ||
|
||
private int value; | ||
|
||
private SSCCFilterValue(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<Integer, SSCCFilterValue> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (SSCCFilterValue rae : SSCCFilterValue.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static SSCCFilterValue forCode(int code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
} |
37 changes: 37 additions & 0 deletions
37
epctagcoder/src/main/java/org/epctagcoder/option/SSCC/SSCCHeader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.epctagcoder.option.SSCC; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum SSCCHeader { | ||
HEADER_00110001("00110001") { | ||
public Integer getTagSize() { | ||
return 96; | ||
} | ||
}; | ||
|
||
private String value; | ||
public abstract Integer getTagSize(); | ||
|
||
|
||
private SSCCHeader(String value) { | ||
this.value = value; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<String, SSCCHeader> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (SSCCHeader rae : SSCCHeader.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static SSCCHeader forCode(String code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
} |
36 changes: 36 additions & 0 deletions
36
epctagcoder/src/main/java/org/epctagcoder/option/SSCC/SSCCTagSize.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.epctagcoder.option.SSCC; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.Map; | ||
|
||
public enum SSCCTagSize { | ||
BITS_96(96) { | ||
public Integer getHeader() { | ||
return 49; | ||
} | ||
}; | ||
|
||
private int value; | ||
public abstract Integer getHeader(); | ||
|
||
private SSCCTagSize(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int getValue() { | ||
return value; | ||
} | ||
|
||
private static final Map<Integer, SSCCTagSize> BY_CODE_MAP = new LinkedHashMap<>(); | ||
static { | ||
for (SSCCTagSize rae : SSCCTagSize.values()) { | ||
BY_CODE_MAP.put(rae.value, rae); | ||
} | ||
} | ||
|
||
public static SSCCTagSize forCode(int code) { | ||
return BY_CODE_MAP.get(code); | ||
} | ||
|
||
|
||
} |
49 changes: 49 additions & 0 deletions
49
...oder/src/main/java/org/epctagcoder/option/SSCC/partitionTable/SSCCPartitionTableList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package org.epctagcoder.option.SSCC.partitionTable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.epctagcoder.option.TableItem; | ||
|
||
|
||
public class SSCCPartitionTableList { | ||
static final private List<TableItem> list = new ArrayList<TableItem>(); | ||
|
||
static { | ||
list.add( new TableItem(0, 40, 12, 18, 5) ); | ||
list.add( new TableItem(1, 37, 11, 21, 6) ); | ||
list.add( new TableItem(2, 34, 10, 24, 7) ); | ||
list.add( new TableItem(3, 30, 9, 28, 8) ); | ||
list.add( new TableItem(4, 27, 8, 31, 9) ); | ||
list.add( new TableItem(5, 24, 7, 34, 10) ); | ||
list.add( new TableItem(6, 20, 6, 38, 11) ); | ||
} | ||
|
||
public SSCCPartitionTableList() { | ||
|
||
} | ||
|
||
public TableItem getPartitionByL(Integer index) { | ||
TableItem tableItem = null; | ||
for (TableItem item : list) { | ||
if (item.getL()==index) { | ||
tableItem = item; | ||
break; | ||
} | ||
} | ||
return tableItem; | ||
} | ||
|
||
public TableItem getPartitionByValue(Integer index) { | ||
TableItem tableItem = null; | ||
for (TableItem item : list) { | ||
if (item.getPartitionValue()==index) { | ||
tableItem = item; | ||
break; | ||
} | ||
} | ||
return tableItem; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.