Packageardisia.components.barCode.specifications
Classpublic class Code128
InheritanceCode128 Inheritance Object

See http://www.azalea.com/faq.html/code-128/#Q3 for a good explanation (and http://en.wikipedia.org/wiki/Code_128)

Code set A - alphanumeric data with uppercase letters only and non-typeable control codes.

Code set B - alphanumeric data with upper/lowercase letters, numeric, and punctuation.

If a code set is not specified, the output will default to a Code set B output. Note, this class does not enforce that only legal characters are encoded. Up to the developer. Also, does not support type mixing in a single string.

Quiet zone should be 10 times the width of a line. Not added automatically by this class.



Public Methods
 MethodDefined By
  
encodeForCode128(data:String, type:String = B):String
[static] Encodes a string for the Code 128 specification.
Code128
Protected Methods
 MethodDefined By
  
getCheckSymbol(data:String, type:String = B):String
[static] Calculates and returns the check symbol.
Code128
  
getIndex(symbol:String):int
[static] Returns the index in the encoding array that the passed symbol is defined.
Code128
Method Detail
encodeForCode128()method
public static function encodeForCode128(data:String, type:String = B):String

Encodes a string for the Code 128 specification.

If no code set is provided, a default of "B" will be used.

Parameters

data:String — the string to encode
 
type:String (default = B) — the Code set to use "A" or "B"; defaults to "B"

Returns
String — a String of encoded data
getCheckSymbol()method 
protected static function getCheckSymbol(data:String, type:String = B):String

Calculates and returns the check symbol. See http://en.wikipedia.org/wiki/Code_128#Conversion_To_Char for the methodology

Parameters

data:String
 
type:String (default = B)

Returns
String — a String of the check symbol
getIndex()method 
protected static function getIndex(symbol:String):int

Returns the index in the encoding array that the passed symbol is defined.

Parameters

symbol:String — the symbol to search for in the digitEncoding array

Returns
int — the int index, -1 if not found