Skip to content

Commit

Permalink
Add symbol descriptions for JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
woo-j committed Apr 12, 2015
1 parent 5e7f3d3 commit 7feca9d
Show file tree
Hide file tree
Showing 17 changed files with 403 additions and 16 deletions.
70 changes: 69 additions & 1 deletion src/main/java/uk/org/okapibarcode/backend/AustraliaPost.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

/**
* Implements the <a href="http://auspost.com.au/media/documents/a-guide-to-printing-the-4state-barcode-v31-mar2012.pdf">Australia Post 4-State barcode</a>.
*
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
public class AustraliaPost extends Symbol{
Expand Down Expand Up @@ -62,18 +62,86 @@ public AustraliaPost() {
mode = ausMode.AUSPOST;
}

/**
* Specify encoding of Australia Post Standard Customer Barcode,
* Customer Barcode 2 or Customer Barcode 3 (37-bar, 52-bar and 67-bar
* symbols) depending on input data length. Valid data characters are 0-9,
* A-Z, a-z, space and hash (#). A Format Control Code (FCC) is added and
* should not be included in the input data.
* <p>
* Input data should include a 8-digit Deliver Point ID
* (DPID) optionally followed by customer information as shown below.
* <table cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Input Length</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Required Input Format</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Symbol Length</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>FCC</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Encoding Table</p></th>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>8</p></td>
<td rowspan="1" colspan="1"><p>99999999</p></td>
<td rowspan="1" colspan="1"><p>37-bar</p></td>
<td rowspan="1" colspan="1"><p>11</p></td>
<td rowspan="1" colspan="1"><p>None</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>13</p></td>
<td rowspan="1" colspan="1"><p>99999999AAAAA</p></td>
<td rowspan="1" colspan="1"><p>52-bar</p></td>
<td rowspan="1" colspan="1"><p>59</p></td>
<td rowspan="1" colspan="1"><p>C</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>16</p></td>
<td rowspan="1" colspan="1"><p>9999999999999999</p></td>
<td rowspan="1" colspan="1"><p>52-bar</p></td>
<td rowspan="1" colspan="1"><p>59</p></td>
<td rowspan="1" colspan="1"><p>N</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>18</p></td>
<td rowspan="1" colspan="1"><p>99999999AAAAAAAAAA</p></td>
<td rowspan="1" colspan="1"><p>67-bar</p></td>
<td rowspan="1" colspan="1"><p>62</p></td>
<td rowspan="1" colspan="1"><p>C</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>23</p></td>
<td rowspan="1" colspan="1"><p>99999999999999999999999</p></td>
<td rowspan="1" colspan="1"><p>67-bar</p></td>
<td rowspan="1" colspan="1"><p>62</p></td>
<td rowspan="1" colspan="1"><p>N</p></td>
</tr>
</tbody>
</table>
*/
public void setPostMode() {
mode = ausMode.AUSPOST;
}

/**
* Specify encoding of a Reply Paid version of the Australia Post
* 4-State Barcode (FCC 45) which requires an 8-digit DPID input.
*/
public void setReplyMode() {
mode = ausMode.AUSREPLY;
}

/**
* Specify encoding of a Routing version of the Australia Post 4-State
* Barcode (FCC 87) which requires an 8-digit DPID input.
*/
public void setRouteMode() {
mode = ausMode.AUSROUTE;
}

/**
* Specify encoding of a Redirection version of the Australia Post 4-State
* Barcode (FCC 92) which requires an 8-digit DPID input.
*/
public void setRedirectMode() {
mode = ausMode.AUSREDIRECT;
}
Expand Down
163 changes: 162 additions & 1 deletion src/main/java/uk/org/okapibarcode/backend/AztecCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,180 @@
/**
* Implements Aztec Code bar code symbology
* According to ISO/IEC 24778:2008
*
* <p>
* Aztec Code can encode 8-bit ISO 8859-1 (Latin-1) data (except 0x00 Null
* characters) up to a maximum length of approximately 3800 numeric characters,
* 3000 alphabetic characters or 1900 bytes of data in a two-dimensional
* matrix symbol.
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
public class AztecCode extends Symbol {

private int preferredSize = 0;

/**
* Sets a preferred symbol size. This value may be ignored if
* data string is too large to fit in the specified symbol size.
* Values correspond to symbol sizes as shown in the following
* table:
* <table cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Input</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Symbol Size</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Input</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Symbol Size</p></th>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>1</p></td>
<td rowspan="1" colspan="1"><p>15 x 15*</p></td>
<td rowspan="1" colspan="1"><p>19</p></td>
<td rowspan="1" colspan="1"><p>79 x 79</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>2</p></td>
<td rowspan="1" colspan="1"><p>19 x 19*</p></td>
<td rowspan="1" colspan="1"><p>20</p></td>
<td rowspan="1" colspan="1"><p>83 x 83</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>3</p></td>
<td rowspan="1" colspan="1"><p>23 x 23*</p></td>
<td rowspan="1" colspan="1"><p>21</p></td>
<td rowspan="1" colspan="1"><p>87 x 87</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>4</p></td>
<td rowspan="1" colspan="1"><p>27 x 27*</p></td>
<td rowspan="1" colspan="1"><p>22</p></td>
<td rowspan="1" colspan="1"><p>91 x 91</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>5</p></td>
<td rowspan="1" colspan="1"><p>19 x 19</p></td>
<td rowspan="1" colspan="1"><p>23</p></td>
<td rowspan="1" colspan="1"><p>95 x 95</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>6</p></td>
<td rowspan="1" colspan="1"><p>23 x 23</p></td>
<td rowspan="1" colspan="1"><p>24</p></td>
<td rowspan="1" colspan="1"><p>101 x 101</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>7</p></td>
<td rowspan="1" colspan="1"><p>27 x 27</p></td>
<td rowspan="1" colspan="1"><p>25</p></td>
<td rowspan="1" colspan="1"><p>105 x 105</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>8</p></td>
<td rowspan="1" colspan="1"><p>31 x 31</p></td>
<td rowspan="1" colspan="1"><p>26</p></td>
<td rowspan="1" colspan="1"><p>109 x 109</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>9</p></td>
<td rowspan="1" colspan="1"><p>37 x 37</p></td>
<td rowspan="1" colspan="1"><p>27</p></td>
<td rowspan="1" colspan="1"><p>113 x 113</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>10</p></td>
<td rowspan="1" colspan="1"><p>41 x 41</p></td>
<td rowspan="1" colspan="1"><p>28</p></td>
<td rowspan="1" colspan="1"><p>117 x 117</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>11</p></td>
<td rowspan="1" colspan="1"><p>45 x 45</p></td>
<td rowspan="1" colspan="1"><p>29</p></td>
<td rowspan="1" colspan="1"><p>121 x 121</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>12</p></td>
<td rowspan="1" colspan="1"><p>49 x 49</p></td>
<td rowspan="1" colspan="1"><p>30</p></td>
<td rowspan="1" colspan="1"><p>125 x 125</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>13</p></td>
<td rowspan="1" colspan="1"><p>53 x 53</p></td>
<td rowspan="1" colspan="1"><p>31</p></td>
<td rowspan="1" colspan="1"><p>131 x 131</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>14</p></td>
<td rowspan="1" colspan="1"><p>57 x 57</p></td>
<td rowspan="1" colspan="1"><p>32</p></td>
<td rowspan="1" colspan="1"><p>135 x 135</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>15</p></td>
<td rowspan="1" colspan="1"><p>61 x 61</p></td>
<td rowspan="1" colspan="1"><p>33</p></td>
<td rowspan="1" colspan="1"><p>139 x 139</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>16</p></td>
<td rowspan="1" colspan="1"><p>67 x 67</p></td>
<td rowspan="1" colspan="1"><p>34</p></td>
<td rowspan="1" colspan="1"><p>143 x 143</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>17</p></td>
<td rowspan="1" colspan="1"><p>71 x 71</p></td>
<td rowspan="1" colspan="1"><p>35</p></td>
<td rowspan="1" colspan="1"><p>147 x 147</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>18</p></td>
<td rowspan="1" colspan="1"><p>75 x 75</p></td>
<td rowspan="1" colspan="1"><p>36</p></td>
<td rowspan="1" colspan="1"><p>151 x 151</p></td>
</tr>
</tbody>
</table>
* @param size An <em>integer</em> in the range 1 - 36
*/
public void setPreferredSize(int size) {
preferredSize = size;
}

private int preferredEccLevel = -1;

/**
* Sets the preferred minimum amount of symbol space dedicated to
* error correction. This value will be ignored if a symbol size has been
* set by <code>setPreferredSize</code> Valid options
* are:
* <table cellspacing="0" cellpadding="5">
<tbody>
<tr>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Mode</p></th>
<th colspan="1" rowspan="1" bgcolor="#999999"><p>Error Correction Capacity</p></th>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>1</p></td>
<td rowspan="1" colspan="1"><p>&gt;10% + 3 codewords</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>2</p></td>
<td rowspan="1" colspan="1"><p>&gt;23% + 3 codewords</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>3</p></td>
<td rowspan="1" colspan="1"><p>&gt;36% + 3 codewords</p></td>
</tr>
<tr>
<td rowspan="1" colspan="1"><p>4</p></td>
<td rowspan="1" colspan="1"><p>&gt;50% + 3 codewords</p></td>
</tr>
</tbody>
</table>
* @param eccLevel An <em>integer</em> in the range 1 - 4
*/
public void setPreferredEccLevel (int eccLevel) {
preferredEccLevel = eccLevel;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/uk/org/okapibarcode/backend/AztecRune.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
/**
* Implements Aztec Runes bar code symbology
* According to ISO/IEC 24778:2008 Annex A
* <p>
* Aztec Runes is a fixed-size matrix symbology which can encode whole
* integer values between 0 and 255.
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/uk/org/okapibarcode/backend/ChannelCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/**
* Implements Channel Code
* According to ANSI/AIM BC12-1998
* <p>
* Channel code encodes whole integer values between 0 and 7,742,862.
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
Expand All @@ -29,6 +31,11 @@ public class ChannelCode extends Symbol {
private String horizontalSpacing;
private int requestedNumberOfChannels = 0;

/**
* Set the number of channels used to encode data. This setting will be
* ignored if the value to be encoded requires more channels.
* @param channels Number of channels in range 3 - 8
*/
public void setNumberOfChannels(int channels) {
if ((channels >= 3) && (channels <= 7)) {
requestedNumberOfChannels = channels;
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/uk/org/okapibarcode/backend/Codabar.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@


/**
* Implements Codabar
* Implements Codabar barcode symbology
* According to BS EN 798:1996
* <p>
* Also known as NW-7, Monarch, ABC Codabar, USD-4, Ames Code and Code 27.
* Codabar can encode any length string starting and ending with the letters
* A-D and containing between these letters the numbers 0-9, dash (-), dollar
* ($), colon (:), slash (/), full stop (.) or plus (+). No check digit is
* generated.
*
* @author <a href="mailto:jakel2006@me.com">Robert Elliott</a>
*/
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/uk/org/okapibarcode/backend/CodablockF.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
import java.io.UnsupportedEncodingException;

/**
* Implements Codablock-F
* Implements Codablock-F according to AIM Europe "Uniform Symbology
* Specification - Codablock F", 1995
* <p>
* Codablock F is a multi-row symbology using Code 128 encoding. It can
* encode any 8-bit ISO 8859-1 (Latin-1) data up to approximately 1000
* alpha-numeric characters or 2000 numeric digits in length.
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/uk/org/okapibarcode/backend/Code11.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

/**
* Implements Code 11 bar code symbology.
* <p>
* Code 11 can encode any length string consisting of the digits 0-9 and the
* dash character (-). One modulo-11 check digit is calculated.
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
Expand Down
16 changes: 13 additions & 3 deletions src/main/java/uk/org/okapibarcode/backend/Code128.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
/**
* Implements Code 128 bar code symbology
* According to ISO/IEC 15417:2007
* <p>
* Code 128 supports encoding of 8-bit ISO 8859-1 (Latin-1) characters.
* Setting GS1 mode allows encoding in GS1-128 (also known as UPC/EAN-128).
*
* @author <a href="mailto:rstuart114@gmail.com">Robin Stuart</a>
*/
Expand Down Expand Up @@ -63,23 +66,30 @@ public Code128() {
compositeMode = Composite.OFF;
}

/**
* Allow the use of subset C (numeric compression) in encoding (default).
*/
public void useModeC() {
modeCSupression = false;
}

/**
* Disallow the use of subset C (numeric compression) in encoding.
* Numeric values will be encoded using subset B.
*/
public void stopModeC() {
modeCSupression = true;
}

public void setCca() {
protected void setCca() {
compositeMode = Composite.CCA;
}

public void setCcb() {
protected void setCcb() {
compositeMode = Composite.CCB;
}

public void setCcc() {
protected void setCcc() {
compositeMode = Composite.CCC;
}

Expand Down
Loading

0 comments on commit 7feca9d

Please sign in to comment.