com.stc.eindex.objects
Class ObjectField

java.lang.Object
  extended bycom.stc.eindex.objects.ObjectField
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class ObjectField
extends java.lang.Object
implements java.io.Externalizable

The ObjectField class defines the fields contained in an object node (ObjectNode class. It includes the

See Also:
Serialized Form

Constructor Summary
ObjectField()
          Creates a new instance of the ObjectField class.
ObjectField(java.lang.String name, int type)
          Creates a new instance of the ObjectField class by its name and data type.
ObjectField(java.lang.String name, int type, java.lang.Object value)
          Creates a new instance of the ObjectField class by its name, data type, and value.
ObjectField(java.lang.String name, int type, java.lang.Object value, FieldFlag flag)
          Creates a new instance of the ObjectField class by its name, data type, value, and field flag.
 
Method Summary
 ObjectField copy()
          Creates a copy of the field object.
static boolean equals(ObjectField field1, ObjectField field2)
          Compares two field objects and determines whether they are the same.
static java.lang.Class getClass(int type)
          Retrieves the Java class associated with the given data type.
 FieldFlag getFieldFlag()
          Retrieves the given field's flag.
 boolean getFlag(int mask)
          Retrieves the value of the specified flag in the field object.
 java.lang.String getName()
          Retrieves the name of the field.
 int getType()
          Retrieves the data type of the field.
static java.lang.String getTypeString(int type)
          Retrieves the string value of the given data type.
 java.lang.Object getValue()
          Retrieves the value of the field.
 boolean hasReadAccess()
          Checks whether the field has read access.
 boolean hasUpdateAccess()
          Checks whether the field has update access.
 boolean isChanged()
          Checks whether the field value has changed.
 boolean isKeyType()
          Checks whether the field is a key type field.
 boolean isNull()
          Checks whether the field contains a null value.
 boolean isNullable()
          Checks whether the field can be null.
 boolean isSearched()
          Checks whether the field is used as criteria in searches.
static boolean isValueValid(int type, java.lang.Object value)
          Verifies that the given value is of the given data type.
 boolean isVisible()
          Checks whether the field is visible on the Enterprise Data Manager (EDM).
 void setChanged(boolean flag)
          Sets the value of the isChanged flag, indicating whether the field value has changed.
 void setFlag(int mask, boolean flag)
          Sets the flag of the field object by its bit mask.
 void setKeyType(boolean flag)
          Specifies whether the field is a key type field.
 void setNull(boolean flag)
          Specifies whether the field contains a null value.
 void setNullable(boolean flag)
          Specifies whether the field can be set to null.
 void setReadAccess(boolean flag)
          Sets the value of the field's read access flag, indicating whether the field has read access.
 void setSearched(boolean flag)
          Specifies whether the field is used as search criteria.
 void setUpdateAccess(boolean flag)
          Sets the value of the field's update access flag, indicating whether the field has update access.
 void setValue(java.lang.Object value)
          Sets a value into the field.
 void setVisible(boolean flag)
          Specifies whether the field is visible on the EDM.
 java.lang.String toString()
          Returns a string representation of the field object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectField

public ObjectField()
Creates a new instance of the ObjectField class.

Parameters:
None.
Throws:
None.


ObjectField

public ObjectField(java.lang.String name,
                   int type)
Creates a new instance of the ObjectField class by its name and data type.

Parameters:
name - The name of the field.
type - The data type for the field.
Throws:
None.

ObjectField

public ObjectField(java.lang.String name,
                   int type,
                   java.lang.Object value)
            throws ObjectException
Creates a new instance of the ObjectField class by its name, data type, and value.

Parameters:
name - The name of the field.
type - The data type for the field.
value - The value of the field.
Throws:
ObjectException - Thrown if an error occurs while creating the field.

ObjectField

public ObjectField(java.lang.String name,
                   int type,
                   java.lang.Object value,
                   FieldFlag flag)
            throws ObjectException
Creates a new instance of the ObjectField class by its name, data type, value, and field flag.

Parameters:
name - The name of the field.
type - The data type for the field.
value - The value of the field.
flag - The initial value of the field flag.
Throws:
ObjectException - Thrown if an error occurs while creating the field.
Method Detail

copy

public ObjectField copy()
                 throws ObjectException
Creates a copy of the field object.

Parameters:
None.

Returns:
ObjectField - A copy of the given field object.
Throws:
ObjectException - Thrown if an error occurs while creating the copy.

equals

public static boolean equals(ObjectField field1,
                             ObjectField field2)
                      throws ObjectException
Compares two field objects and determines whether they are the same.

Parameters:
field1 - The first field object to compare.
field2 - The second field object to compare.
Returns:
boolean - An indicator of whether the field objects are the same. Boolean true indicates the field objects are the same; False indicates they are not.
Throws:
ObjectException - Thrown if an error occurs while comparing the fields.

getClass

public static java.lang.Class getClass(int type)
                                throws ObjectException
Retrieves the Java class associated with the given data type.

Parameters:
type - An integer representing a data type for a field.
Returns:
Class - The class associated with the data type.
Throws:
ObjectException - Thrown if an error occurs while retrieving the class.

getFieldFlag

public FieldFlag getFieldFlag()
Retrieves the given field's flag.

Parameters:
None.

Returns:
FieldFlag - The field's flag.
Throws:
None.

getFlag

public boolean getFlag(int mask)
                throws ObjectException
Retrieves the value of the specified flag in the field object.

Parameters:
mask - An integer representing the field flag to check.
Returns:
boolean - The Boolean value of the flag specified.
Throws:
ObjectException - Thrown if an error occurs while retrieving the flag value.

getName

public java.lang.String getName()
Retrieves the name of the field.

Parameters:
None.

Returns:
String - The name of the field.
Throws:
None.

getType

public int getType()
Retrieves the data type of the field.

Parameters:
None.

Returns:
int - An integer representing the data type.
Throws:
None.

getTypeString

public static java.lang.String getTypeString(int type)
Retrieves the string value of the given data type.

Parameters:
type - An integer representing a data type for a field.
Returns:
String - The string value for the data type.
Throws:
None.

getValue

public java.lang.Object getValue()
Retrieves the value of the field.

Parameters:
None.

Returns:
Object - The value of the field.
Throws:
None.

hasReadAccess

public boolean hasReadAccess()
Checks whether the field has read access.

Parameters:
None.

Returns:
boolean - An indicator of whether the field has read access. Boolean true indicates the field has read access; false indicates it does not.
Throws:
None.

hasUpdateAccess

public boolean hasUpdateAccess()
Checks whether the field has update access.

Parameters:
None.

Returns:
boolean - An indicator of whether the field has update access. Boolean true indicates the field has update access; false indicates it does not.
Throws:
None.

isChanged

public boolean isChanged()
Checks whether the field value has changed.

Parameters:
None.

Returns:
boolean - An indicator of whether the field value has changed. Boolean true indicates the field value has changed; false indicates it has not changed.
Throws:
None.

isKeyType

public boolean isKeyType()
Checks whether the field is a key type field.

Parameters:
None.

Returns:
boolean - An indicator of whether the field is a key type field. Boolean true indicates the field is key type; false indicates it is not.
Throws:
None.

isNull

public boolean isNull()
Checks whether the field contains a null value.

Parameters:
None.

Returns:
boolean - An indicator of whether the field is null. Boolean true indicates the field is null; false indicates it is not.
Throws:
None.

isNullable

public boolean isNullable()
Checks whether the field can be null.

Parameters:
None.

Returns:
boolean - An indicator of whether the field can be null. Boolean true indicates the field can be null; false indicates it cannot.
Throws:
None.

isSearched

public boolean isSearched()
Checks whether the field is used as criteria in searches.

Parameters:
None.

Returns:
boolean - An indicator of whether the field is used for searching. Boolean true indicates the field is used for searching; false indicates it is not.
Throws:
None.

isValueValid

public static boolean isValueValid(int type,
                                   java.lang.Object value)
Verifies that the given value is of the given data type.

Parameters:
type - An integer representing a data type for a field.
value - A field value to check against the data type.
Returns:
Boolean - An indicator of whether the field value is of the given value type. Boolean true indicates the field value is of the given type; false indicates it is not.
Throws:
None.

isVisible

public boolean isVisible()
Checks whether the field is visible on the Enterprise Data Manager (EDM).

Parameters:
None.

Returns:
boolean - An indicator of whether the field is visible on the EDM. Boolean true indicates the field is visible; false indicates it is not.
Throws:
None.

setChanged

public void setChanged(boolean flag)
Sets the value of the isChanged flag, indicating whether the field value has changed.

Parameters:
flag - A Boolean indicator of whether the field value is changed. Boolean true indicates the field is changed; false indicates it is not.
Returns:
void - None.
Throws:
None.

setFlag

public void setFlag(int mask,
                    boolean flag)
             throws ObjectException
Sets the flag of the field object by its bit mask.

Parameters:
mask - The bit mask of the flag to set.
flag - The Boolean value to set in the flag.
Returns:
void - None.
Throws:
ObjectException - Thrown if an error occurs while setting the flag.

setKeyType

public void setKeyType(boolean flag)
Specifies whether the field is a key type field.

Parameters:
flag - A Boolean indicator of whether the field is a key field. Boolean true indicates the field is a key field; false indicates it is not.
Returns:
void - None.
Throws:
None.

setNull

public void setNull(boolean flag)
Specifies whether the field contains a null value.

Parameters:
flag - A Boolean indicator of whether the field is null. Boolean true indicates the field is null; false indicates it is not.
Returns:
void - None.
Throws:
None.

setNullable

public void setNullable(boolean flag)
Specifies whether the field can be set to null.

Parameters:
flag - A Boolean indicator of whether the field can be null. Boolean true indicates the field can be null false indicates it cannot.
Returns:
void - None.
Throws:
None.

setReadAccess

public void setReadAccess(boolean flag)
Sets the value of the field's read access flag, indicating whether the field has read access.

Parameters:
flag - A Boolean indicator of whether the field has read access. Boolean true indicates the field has read access; false indicates it does not.
Returns:
void - None.
Throws:
None.

setSearched

public void setSearched(boolean flag)
Specifies whether the field is used as search criteria.

Parameters:
flag - A Boolean indicator of whether the field is used for searches. Boolean true indicates the field is used as search criteria; false indicates it is not.
Returns:
void - None.
Throws:
None.

setUpdateAccess

public void setUpdateAccess(boolean flag)
Sets the value of the field's update access flag, indicating whether the field has update access.

Parameters:
flag - A Boolean indicator of whether the field has update access. Boolean true indicates the field has update access; false indicates it does not.
Returns:
void - None.
Throws:
None.

setValue

public void setValue(java.lang.Object value)
              throws ObjectException
Sets a value into the field.

Parameters:
value - An object containing the value to set in the field.
Returns:
void - None.
Throws:
ObjectException - Thrown if an error occurs while setting the field value.

setVisible

public void setVisible(boolean flag)
Specifies whether the field is visible on the EDM.

Parameters:
flag - A Boolean indicator of whether the field is visible on the EDM. Boolean true indicates the field is visible; false indicates it is not.
Returns:
void - None.
Throws:
None.

toString

public java.lang.String toString()
Returns a string representation of the field object.

Parameters:
None.

Returns:
String - A string representation of the field object.
Throws:
None.


Copyright 2007 by Sun Microsystems, Inc. All Rights Reserved.