com.phidgets
Class IRCode

java.lang.Object
  extended bycom.phidgets.IRCode

public final class IRCode
extends java.lang.Object

This class represents an IR Code.

Author:
Phidget Inc.

Constructor Summary
IRCode(short[] data, int bitCount)
          Creates a new IR Code from a data array.
IRCode(java.lang.String code, int bitCount)
          Creates a new IR Code from a string.
 
Method Summary
 int getBitCount()
          Data bits.
 short[] getData()
          IR code data.
 java.lang.String toString()
          String representation of the IR code.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IRCode

public IRCode(java.lang.String code,
              int bitCount)
Creates a new IR Code from a string.

Parameters:
code - the IR code
bitCount - the code length in bits.

IRCode

public IRCode(short[] data,
              int bitCount)
Creates a new IR Code from a data array.

Parameters:
data - the IR code data
bitCount - the code length in bits.
Method Detail

getData

public short[] getData()
IR code data. This is MSB first, right justified. This is really an (unsigned) Byte array, so values range from 0-255. We have to use shorts because Java doesn't support unsigned types.


getBitCount

public int getBitCount()
Data bits. This is important because many codes use a number of bits that doesn't line up with byte (8-bit) borders.


toString

public java.lang.String toString()
String representation of the IR code.