chtdecoder.datastructures
Interface CHTCode

All Known Implementing Classes:
AbstractCHTCode

public interface CHTCode

An interface to represent a ZSNES CHT code.

Version:
1.1, 09/14/04
Author:
John David Ratliff

Method Summary
 int getAddress()
          Gets the address of this CHTCode.
 java.lang.String getName()
          Gets the name of this CHTCode.
 int getValue()
          Gets the value of this CHTCode.
 boolean isActive()
          Asks if this CHTCode is active (turned ON).
 void setActive(boolean active)
          Sets whether this CHTCode is active or not.
 void setAddress(int address)
          Sets the address of this CHTCode.
 void setName(java.lang.String name)
          Sets the name of this CHTCode (18 characters max).
 void setValue(int value)
          Sets the value of this CHTCode.
 

Method Detail

isActive

public boolean isActive()
Asks if this CHTCode is active (turned ON).

Returns:
true if this CHTCode is active; false otherwise.

setActive

public void setActive(boolean active)
Sets whether this CHTCode is active or not.

Parameters:
active - true for active (ON); false for inactive (OFF).

getAddress

public int getAddress()
Gets the address of this CHTCode.

Returns:
The address.

setAddress

public void setAddress(int address)
                throws InvalidAddressException
Sets the address of this CHTCode.

Parameters:
address - The address.
Throws:
InvalidAddressException - if the address is outside the range 0-16777215 (2^24 - 1).

getValue

public int getValue()
Gets the value of this CHTCode.

Returns:
The value.

setValue

public void setValue(int value)
              throws InvalidValueException
Sets the value of this CHTCode.

Parameters:
value - The value.
Throws:
InvalidValueException - if the value is outside the range 0-255 (2^8 - 1).

getName

public java.lang.String getName()
Gets the name of this CHTCode.

Returns:
The name.

setName

public void setName(java.lang.String name)
             throws NameTooLongException
Sets the name of this CHTCode (18 characters max).

Parameters:
name - The name.
Throws:
NameTooLongException - if the new name is longer than 18 characters.