ORG.popbeads.CCScan
Class CCScan

java.lang.Object
  |
  +--ORG.popbeads.CCScan.CCScan

public class CCScan
extends java.lang.Object

This class provides methods for decoding and storing data obtained from barcode scanners. It is designed specifically to handle the codes provided by the :CueCat(TM) handheld scanner. The :CueCat scanner is a clever little device given away as part of an advertising promotion by DigitalConvergence.:Com. You plug the :CueCat into your keyboard port, and scans performed by the :CueCat act like ordinary keystrokes. This makes the :CueCat exceptionally easy for programmers to incorporate into their own software.
The scans provided by a :CueCat scanner ordinarily contain three pieces of information:

1. The serial number of the :CueCat unit being used.

2. The type of the scan (e.g. IB5, CC!, UPC).

3. The data contained in the barcode.

All three can be accessed using methods provided by CCScan. For example, when the raw data string provided by the :CueCat is .C3nZC3nZC3nZDNz3CND6CxnX.fHmc.C3DZCxPWCNzXCNn6., CCScan can provide:

Serial Number: 000000000554149202

Type: UPA

Data: 040293152109

as well as the raw data:
Undecoded Serial Number: C3nZC3nZC3nZDNz3CND6CxnX

Undecoded Type: fHmc

Undecoded Data: C3DZCxPWCNzXCNn6



For more information about the CCScan package visit http://www.popbeads.org.

Author:
Stephen Wooding (stephen@popbeads.org)

Constructor Summary
CCScan()
          Instantiate an empty CCScan object.
CCScan(java.lang.String scanData)
          Instantiate a CCScan object containing scan data supplied by the :CueCat(TM) scanner.
 
Method Summary
 void decode()
          Decode the raw scan data currently stored by the CCScan object.
 java.lang.String getCodeData()
          Get the decoded bar code data contained in the scan currently held by the CCScan object.
 java.lang.String getCodeType()
          Get the decoded bar code type of the scan currently held by the CCScan object.
 java.lang.String getRawCodeData()
          Get the undecoded String representing the type of bar code data currently held by the CCScan object.
 java.lang.String getRawCodeType()
          Get the undecoded String representing the code type of the scan currently held by the CCScan object.
 java.lang.String getRawScanData()
          Get the raw scan currently held by the CCScan object.
 java.lang.String getRawSerialNumber()
          Get the undecoded String representing the serial number of the :CueCat unit that was used to scan data.
 java.lang.String getSerialNumber()
          Get the decoded serial number of the :CueCat unit that provided the scan currently held by the CCScan object.
static void main(java.lang.String[] args)
          This method provides a command line tool for examining bar code scans performed by the :CueCat handheld scanning device.
 void quickScan(java.lang.String scanData)
          Set the data contained by the CCScan object, and decode it automatically and immediately.
 void setScanData(java.lang.String scanData)
          Set the data contained by the CCScan object, but do not decode it immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CCScan

public CCScan()
Instantiate an empty CCScan object.

CCScan

public CCScan(java.lang.String scanData)
Instantiate a CCScan object containing scan data supplied by the :CueCat(TM) scanner.
Parameters:
scanData - Raw data provided by the :CueCat scanner.
Method Detail

quickScan

public void quickScan(java.lang.String scanData)
               throws BadScanException
Set the data contained by the CCScan object, and decode it automatically and immediately.
Parameters:
scanData - Raw data provided by the :CueCat scanner.

setScanData

public void setScanData(java.lang.String scanData)
                 throws BadScanException
Set the data contained by the CCScan object, but do not decode it immediately.
Parameters:
scanData - Raw data provided by the :CueCat scanner.

decode

public void decode()
            throws BadScanException
Decode the raw scan data currently stored by the CCScan object.

getSerialNumber

public java.lang.String getSerialNumber()
Get the decoded serial number of the :CueCat unit that provided the scan currently held by the CCScan object.

getCodeType

public java.lang.String getCodeType()
Get the decoded bar code type of the scan currently held by the CCScan object.

getCodeData

public java.lang.String getCodeData()
Get the decoded bar code data contained in the scan currently held by the CCScan object.

getRawScanData

public java.lang.String getRawScanData()
Get the raw scan currently held by the CCScan object.

getRawSerialNumber

public java.lang.String getRawSerialNumber()
Get the undecoded String representing the serial number of the :CueCat unit that was used to scan data.

getRawCodeType

public java.lang.String getRawCodeType()
Get the undecoded String representing the code type of the scan currently held by the CCScan object.

getRawCodeData

public java.lang.String getRawCodeData()
Get the undecoded String representing the type of bar code data currently held by the CCScan object.

main

public static void main(java.lang.String[] args)
This method provides a command line tool for examining bar code scans performed by the :CueCat handheld scanning device. The program reads bar code scanner data from the standard input until the word "quit" or "exit" is encountered.

To run the program, put the CCScan Java package in your classpath and type java CCScan.