jMobileCore toolkit

com.jmobilecore.dstore
Class FieldStructure

java.lang.Object
  extended by com.jmobilecore.dstore.FieldStructure

public class FieldStructure
extends java.lang.Object

A FieldStructure represents a description of a record field

Author:
Greg Gridin

Field Summary
static int BINARY
          The BINARY type.
static int BOOLEAN
          The BOOLEAN type.
static int INTEGER
          The INTEGER type.
 java.lang.String name
          The field name.
static int NULL
          The NULL value.
static int STRING
          The STRING type.
 int type
          The field type.
 
Constructor Summary
FieldStructure(java.lang.String name, int type)
          Creates a field structure.
 
Method Summary
static boolean hasVariableLength(int type)
          Reports whether the type defines data of variable size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY

public static final int BINARY
The BINARY type. First 2 bytes represents offset from beginning of record. Next 2 bytes represents length of string in bytes.

See Also:
Constant Field Values

BOOLEAN

public static final int BOOLEAN
The BOOLEAN type. Values are true and false

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
The INTEGER type. Value range is from -(2**32-1) to 2**32-1

See Also:
Constant Field Values

name

public java.lang.String name
The field name.


NULL

public static final int NULL
The NULL value.

See Also:
Constant Field Values

STRING

public static final int STRING
The STRING type. First 2 bytes represents offset from beginning of record. Next 2 bytes represents length of string in bytes. (Note: this value could differ from string length)

See Also:
Constant Field Values

type

public int type
The field type.

Constructor Detail

FieldStructure

public FieldStructure(java.lang.String name,
                      int type)
Creates a field structure.

Parameters:
name - the field name.
type - the field type
Method Detail

hasVariableLength

public static boolean hasVariableLength(int type)
Reports whether the type defines data of variable size

Parameters:
type - the field type
Returns:
true if type is defines data of variable length, false otherwise

jMobileCore toolkit