ggencoder.datastructures
Class BasicNESRawCode

java.lang.Object
  extended byggencoder.datastructures.AbstractRawCode
      extended byggencoder.datastructures.BasicNESRawCode
All Implemented Interfaces:
NESRawCode, RawCode

public class BasicNESRawCode
extends AbstractRawCode
implements NESRawCode

An implementation of the NESRawCode interface.

Version:
1.3, 07/14/04
Author:
John David Ratliff

Constructor Summary
BasicNESRawCode(int address, int value)
          Creates a new BasicNESRawCode object with no compare value.
BasicNESRawCode(int address, int value, int compare)
          Creates a new BasicNESRawCode 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

BasicNESRawCode

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

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

BasicNESRawCode

public BasicNESRawCode(int address,
                       int value,
                       int compare)
Creates a new BasicNESRawCode 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 NESRawCode
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 NESRawCode
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 NESRawCode
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.