Package com.db4o.internal
Class StoredFieldImpl
- java.lang.Object
-
- com.db4o.internal.StoredFieldImpl
-
- All Implemented Interfaces:
StoredField
public class StoredFieldImpl extends java.lang.Object implements StoredField
-
-
Constructor Summary
Constructors Constructor Description StoredFieldImpl(Transaction transaction, FieldMetadata fieldMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createIndex()
creates an index on this field at runtime.void
dropIndex()
drops an existing index on this field at runtime.boolean
equals(java.lang.Object obj)
FieldMetadata
fieldMetadata()
java.lang.Object
get(java.lang.Object onObject)
returns the field value on the passed object.java.lang.String
getName()
returns the name of the field.ReflectClass
getStoredType()
returns the Class (Java) / Type (.NET) of the field.int
hashCode()
boolean
hasIndex()
Returns whether this field has an index or not.boolean
isArray()
returns true if the field is an array.void
rename(java.lang.String name)
modifies the name of this stored field.void
traverseValues(Visitor4 visitor)
specialized highspeed API to collect all values of a field for all instances of a class, if the field is indexed.
-
-
-
Constructor Detail
-
StoredFieldImpl
public StoredFieldImpl(Transaction transaction, FieldMetadata fieldMetadata)
-
-
Method Detail
-
createIndex
public void createIndex()
Description copied from interface:StoredField
creates an index on this field at runtime.- Specified by:
createIndex
in interfaceStoredField
-
dropIndex
public void dropIndex()
Description copied from interface:StoredField
drops an existing index on this field at runtime.- Specified by:
dropIndex
in interfaceStoredField
-
fieldMetadata
public FieldMetadata fieldMetadata()
-
get
public java.lang.Object get(java.lang.Object onObject)
Description copied from interface:StoredField
returns the field value on the passed object.
This method will also work, if the field is not present in the current version of the class.
It is recommended to use this method for refactoring purposes, if fields are removed and the field values need to be copied to other fields.- Specified by:
get
in interfaceStoredField
-
getName
public java.lang.String getName()
Description copied from interface:StoredField
returns the name of the field.- Specified by:
getName
in interfaceStoredField
-
getStoredType
public ReflectClass getStoredType()
Description copied from interface:StoredField
returns the Class (Java) / Type (.NET) of the field.
For array fields this method will return the type of the array. UseStoredField.isArray()
to detect arrays.- Specified by:
getStoredType
in interfaceStoredField
-
hasIndex
public boolean hasIndex()
Description copied from interface:StoredField
Returns whether this field has an index or not.- Specified by:
hasIndex
in interfaceStoredField
- Returns:
- true if this field has an index.
-
isArray
public boolean isArray()
Description copied from interface:StoredField
returns true if the field is an array.- Specified by:
isArray
in interfaceStoredField
-
rename
public void rename(java.lang.String name)
Description copied from interface:StoredField
modifies the name of this stored field.
After renaming one or multiple fields the ObjectContainer has to be closed and reopened to allow internal caches to be refreshed.- Specified by:
rename
in interfaceStoredField
- Parameters:
name
- the new name
-
traverseValues
public void traverseValues(Visitor4 visitor)
Description copied from interface:StoredField
specialized highspeed API to collect all values of a field for all instances of a class, if the field is indexed.
The field values will be taken directly from the index without the detour through class indexes or object instantiation.
If this method is used to get the values of a first class object index, deactivated objects will be passed to the visitor.- Specified by:
traverseValues
in interfaceStoredField
- Parameters:
visitor
- the visitor to be called with each index value.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-