|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.huguesjohnson.hapsby.SaveGameProperty
public class SaveGameProperty
Class to describe a property (value) of a save game.
| Nested Class Summary | |
|---|---|
static class |
SaveGameProperty.ByteOrder
public enum ByteOrder { LOW_BYTE_FIRST, HIGH_BYTE_FIRST } Whether values are stored high byte first (Big-Endian) or low byte first (Little-Endian). |
static class |
SaveGameProperty.DataType
public enum DataType { TYPE_INTEGER, TYPE_STRING } Data type for the property. |
| Constructor Summary | |
|---|---|
SaveGameProperty()
Default constructor. |
|
SaveGameProperty(java.lang.String name,
java.lang.String description,
SaveGameProperty.ByteOrder byteOrder,
SaveGameProperty.DataType dataType,
int address,
int length,
int maxValue,
int minValue)
Creates a new property. |
|
| Method Summary | |
|---|---|
int |
getAddress()
Returns the address of the property in decimal. |
SaveGameProperty.ByteOrder |
getByteOrder()
Returns the byte order of the property. |
SaveGameProperty.DataType |
getDataType()
Returns the data type of the property. |
java.lang.String |
getDescription()
Returns the description of the property. |
int |
getLength()
Returns the length (number of bytes) of the property. |
int |
getMaxValue()
Returns the maximum value of the property, in decimal. |
int |
getMinValue()
Returns the minimum value of the property, in decimal. |
java.lang.String |
getName()
Returns the name of the property. |
void |
setAddress(int address)
Sets the address & checks if it's valid. |
void |
setByteOrder(SaveGameProperty.ByteOrder byteOrder)
Sets the byte order of this property. |
void |
setDataType(SaveGameProperty.DataType dataType)
Sets the data type of this property. |
void |
setDescription(java.lang.String description)
Sets the description of the property. |
void |
setLength(int length)
Sets the length property, in decimal format, must be > 0. |
void |
setMaxValue(int maxValue)
Sets the maximum value of the property, in decimal format. |
void |
setMinValue(int minValue)
Sets the minimum value of the property, in decimal format. |
void |
setName(java.lang.String name)
Sets the name of the property. |
java.lang.String |
toString()
Returns the property name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SaveGameProperty()
public SaveGameProperty(java.lang.String name,
java.lang.String description,
SaveGameProperty.ByteOrder byteOrder,
SaveGameProperty.DataType dataType,
int address,
int length,
int maxValue,
int minValue)
name - Name of the property.description - Description of the property.byteOrder - Byte order of the property.dataType - Data type of the the property.address - Address of new property, in decimal.length - Length (number of bytes) of the property.maxValue - Maximum value of the property, in decimal.minValue - Minimum value of the property, in decimal.| Method Detail |
|---|
public final void setName(java.lang.String name)
name - The new name of the property.public final void setDescription(java.lang.String description)
description - The new description of the property.
public final void setAddress(int address)
throws java.lang.Exception
address - The new address in decimal form, must be >= 0.
java.lang.Exception - Exception thrown if address is <=0.
public final void setLength(int length)
throws java.lang.Exception
length - The new length of the property.
java.lang.Exception - Exception thrown if length is <=0.public final void setMaxValue(int maxValue)
maxValue - The new maximum value of the property.public final void setMinValue(int minValue)
minValue - The new minimum value of the property.public final java.lang.String getName()
public final java.lang.String getDescription()
public final SaveGameProperty.DataType getDataType()
public final int getAddress()
public final int getLength()
public final int getMaxValue()
public final int getMinValue()
public SaveGameProperty.ByteOrder getByteOrder()
public void setByteOrder(SaveGameProperty.ByteOrder byteOrder)
byteOrder - The new byte order of this property.public void setDataType(SaveGameProperty.DataType dataType)
dataType - The new data type of this property.public java.lang.String toString()
toString() is implicitly called by JList and JTable components when complex objects are added.
This needs to return the text that should be displayed in these controls. In this case, it's the property name.
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||