Skip to content

Commit

Permalink
Code One: add getter, improve javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gredler committed Jul 7, 2018
1 parent 0774eef commit 354fc5a
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/main/java/uk/org/okapibarcode/backend/CodeOne.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
*/
public class CodeOne extends Symbol {

public enum Version {
NONE, A, B, C, D, E, F, G, H, S, T
}

private static final int[] C40_SHIFT = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
Expand Down Expand Up @@ -101,26 +105,32 @@ private enum Mode {
C1_ASCII, C1_C40, C1_DECIMAL, C1_TEXT, C1_EDI, C1_BYTE
};

private Version preferredVersion = Version.NONE;

private int[] data = new int[1500];
private int[][] datagrid = new int[136][120];
private boolean[][] outputGrid = new boolean[148][134];

public enum Version {
NONE, A, B, C, D, E, F, G, H, S, T
}

private Version preferredVersion = Version.NONE;

/**
* Set symbol size by "version". Versions A to H are square symbols.
* This value may be ignored if the input data does not fit in the
* specified version. Version S and T are fixed height symbols.
* @param version Symbol version
* Sets the preferred symbol size / version. Versions A to H are square symbols.
* Version S and T are fixed height symbols. This value may be ignored if the input
* data does not fit in the specified version.
*
* @param version the preferred symbol version
*/
public void setPreferredVersion(Version version) {
preferredVersion = version;
}

/**
* Returns the preferred symbol version.
*
* @return the preferred symbol version
*/
public Version getPreferredVersion() {
return preferredVersion;
}

@Override
protected boolean gs1Supported() {
return true;
Expand Down

0 comments on commit 354fc5a

Please sign in to comment.