NWNFiles.GFFFieldTypes
Class FieldType

java.lang.Object
  |
  +--NWNFiles.GFFFieldTypes.FieldType
Direct Known Subclasses:
FieldTypeBYTE, FieldTypeCExoLocString, FieldTypeCExoString, FieldTypeCHAR, FieldTypeDOUBLE, FieldTypeDWORD, FieldTypeDWORD64, FieldTypeFLOAT, FieldTypeINT, FieldTypeINT64, FieldTypeList, FieldTypeRESREF, FieldTypeSHORT, FieldTypeStruct, FieldTypeVOID, FieldTypeWORD

public abstract class FieldType
extends Object

This class is an abstract class which is used to disign GFF file field types.


Field Summary
static long BYTE_TYPE
          Data type
static long CExoLocString_TYPE
          Data type
static long CExoString_TYPE
          Data type
static long CHAR_TYPE
          Data type
protected static ResourceBundle CurrentLanguage
           
static long DOUBLE_TYPE
          Data type
static long DWORD_TYPE
          Data type
static long DWORD64_TYPE
          Data type
static long FLOAT_TYPE
          Data type
static long INT_TYPE
          Data type
static long INT64_TYPE
          Data type
static long List_TYPE
          Data type
static long RESREF_TYPE
          Data type
static long SHORT_TYPE
          Data type
static long Struct_TYPE
          Data type
static long VOID_TYPE
          Data type
static long WORD_TYPE
          Data type
 
Constructor Summary
FieldType(long _typeNumber)
          Constructs a complex data type.
FieldType(long _typeNumber, boolean _isCplx)
          Constructor
 
Method Summary
 Object cloneData(Object data)
           
static ResourceBundle getCurrentLanguage()
          REturns the local settings used by all FildTypeClasses
abstract  byte[] getData(Object data)
          Returns byte array containing the data.
static FieldType GetInstance(long type)
          Returns an instance of the class representing the data type.
 String getTypeName()
          Returns the data type name.
static String GetTypeName(long type)
          Returns the data type name.
 long getTypeNumber()
          Returns the data type.
abstract  Object interpretData(ByteBuffer buffer)
          Returns a object representing the data stored in the buffer.
 boolean isCplx()
          Tells if the data type is complex.
static void setCurrentLanguage(Locale locale)
          Change the locale settings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BYTE_TYPE

public static final long BYTE_TYPE
Data type

See Also:
Constant Field Values

CExoLocString_TYPE

public static final long CExoLocString_TYPE
Data type

See Also:
Constant Field Values

CExoString_TYPE

public static final long CExoString_TYPE
Data type

See Also:
Constant Field Values

CHAR_TYPE

public static final long CHAR_TYPE
Data type

See Also:
Constant Field Values

CurrentLanguage

protected static ResourceBundle CurrentLanguage

DOUBLE_TYPE

public static final long DOUBLE_TYPE
Data type

See Also:
Constant Field Values

DWORD_TYPE

public static final long DWORD_TYPE
Data type

See Also:
Constant Field Values

DWORD64_TYPE

public static final long DWORD64_TYPE
Data type

See Also:
Constant Field Values

FLOAT_TYPE

public static final long FLOAT_TYPE
Data type

See Also:
Constant Field Values

INT_TYPE

public static final long INT_TYPE
Data type

See Also:
Constant Field Values

INT64_TYPE

public static final long INT64_TYPE
Data type

See Also:
Constant Field Values

List_TYPE

public static final long List_TYPE
Data type

See Also:
Constant Field Values

RESREF_TYPE

public static final long RESREF_TYPE
Data type

See Also:
Constant Field Values

SHORT_TYPE

public static final long SHORT_TYPE
Data type

See Also:
Constant Field Values

Struct_TYPE

public static final long Struct_TYPE
Data type

See Also:
Constant Field Values

VOID_TYPE

public static final long VOID_TYPE
Data type

See Also:
Constant Field Values

WORD_TYPE

public static final long WORD_TYPE
Data type

See Also:
Constant Field Values
Constructor Detail

FieldType

public FieldType(long _typeNumber)
Constructs a complex data type.

Parameters:
_typeNumber - Data type.

FieldType

public FieldType(long _typeNumber,
                 boolean _isCplx)
Constructor

Parameters:
_typeNumber - Data type.
_isCplx - A boolean telling if the data type is complex.
Method Detail

getCurrentLanguage

public static ResourceBundle getCurrentLanguage()
REturns the local settings used by all FildTypeClasses

Returns:
A ResourceBundle.

GetInstance

public static FieldType GetInstance(long type)
                             throws InvalidType
Returns an instance of the class representing the data type.

Parameters:
type - Data type.
InvalidType

GetTypeName

public static String GetTypeName(long type)
Returns the data type name.

Parameters:
type - Data type.

setCurrentLanguage

public static void setCurrentLanguage(Locale locale)
Change the locale settings

Parameters:
locale - New locale

getData

public abstract byte[] getData(Object data)
Returns byte array containing the data.

Parameters:
data - The object representing the data.

getTypeName

public final String getTypeName()
Returns the data type name.


getTypeNumber

public long getTypeNumber()
Returns the data type.


interpretData

public abstract Object interpretData(ByteBuffer buffer)
Returns a object representing the data stored in the buffer.

Parameters:
buffer - A buffer containing the data. The current position of the buffer should be the biginning of the data.

isCplx

public final boolean isCplx()
Tells if the data type is complex.

Returns:
true if the data type is complex.

cloneData

public Object cloneData(Object data)
Parameters:
data -
Returns: