ggencoder.datastructures
Class BasicGBGGRawCode

java.lang.Object
  extended byggencoder.datastructures.AbstractRawCode
      extended byggencoder.datastructures.BasicGBGGRawCode
All Implemented Interfaces:
GBGGRawCode, RawCode

public class BasicGBGGRawCode
extends AbstractRawCode
implements GBGGRawCode

An implementation of the GBGGRawCode interface.

Version:
1.4, 07/15/04
Author:
John David Ratliff

Constructor Summary
BasicGBGGRawCode(int address, int value)
          Creates a new BasicGBGGRawCode object without a compare or shadow value.
BasicGBGGRawCode(int address, int value, int compare)
          Creates a new BasicGBGGRawCode object with a compare value.
 
Method Summary
 int getCompareValue()
          Gets this code's compare value.
 boolean hasCompareValue()
          Queries if this code uses a compare value.
 void setAddress(int address)
          Sets the address of this code.
 void setCompareValue(int compare)
          Sets this code's compare value.
 void setValue(int value)
          Sets the value of this code.
 java.lang.String toString()
          Returns a String representation of this code.
 
Methods inherited from class ggencoder.datastructures.AbstractRawCode
getAddress, getValue, toHexString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ggencoder.datastructures.RawCode
getAddress, getValue
 

Constructor Detail

BasicGBGGRawCode

public BasicGBGGRawCode(int address,
                        int value)
Creates a new BasicGBGGRawCode object without a compare or shadow value.

Parameters:
address - This code's address.
value - This code's value.

BasicGBGGRawCode

public BasicGBGGRawCode(int address,
                        int value,
                        int compare)
Creates a new BasicGBGGRawCode object with a compare value.

Parameters:
address - This code's address.
value - This code's value.
compare - This code's compare value.
Method Detail

hasCompareValue

public boolean hasCompareValue()
Queries if this code uses a compare value.

Specified by:
hasCompareValue in interface GBGGRawCode
Returns:
true if a compare value is used; false otherwise.

getCompareValue

public int getCompareValue()
                    throws NoCompareValueException
Gets this code's compare value.

Specified by:
getCompareValue in interface GBGGRawCode
Returns:
The compare value.
Throws:
NoCompareValueException - if no compare value is used by this code.

setCompareValue

public void setCompareValue(int compare)
                     throws NoCompareValueException
Sets this code's compare value.

Specified by:
setCompareValue in interface GBGGRawCode
Parameters:
compare - The new compare value.
Throws:
NoCompareValueException - f no compare value is used by this code.

setAddress

public void setAddress(int address)
Sets the address of this code.

Specified by:
setAddress in interface RawCode
Overrides:
setAddress in class AbstractRawCode
Parameters:
address - The code's address.

setValue

public void setValue(int value)
Sets the value of this code.

Specified by:
setValue in interface RawCode
Overrides:
setValue in class AbstractRawCode
Parameters:
value - The code's value.

toString

public java.lang.String toString()
Returns a String representation of this code.

Returns:
A String representation.