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 voidcreateIndex()creates an index on this field at runtime.voiddropIndex()drops an existing index on this field at runtime.booleanequals(java.lang.Object obj)FieldMetadatafieldMetadata()java.lang.Objectget(java.lang.Object onObject)returns the field value on the passed object.java.lang.StringgetName()returns the name of the field.ReflectClassgetStoredType()returns the Class (Java) / Type (.NET) of the field.inthashCode()booleanhasIndex()Returns whether this field has an index or not.booleanisArray()returns true if the field is an array.voidrename(java.lang.String name)modifies the name of this stored field.voidtraverseValues(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:StoredFieldcreates an index on this field at runtime.- Specified by:
createIndexin interfaceStoredField
-
dropIndex
public void dropIndex()
Description copied from interface:StoredFielddrops an existing index on this field at runtime.- Specified by:
dropIndexin interfaceStoredField
-
fieldMetadata
public FieldMetadata fieldMetadata()
-
get
public java.lang.Object get(java.lang.Object onObject)
Description copied from interface:StoredFieldreturns 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:
getin interfaceStoredField
-
getName
public java.lang.String getName()
Description copied from interface:StoredFieldreturns the name of the field.- Specified by:
getNamein interfaceStoredField
-
getStoredType
public ReflectClass getStoredType()
Description copied from interface:StoredFieldreturns 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:
getStoredTypein interfaceStoredField
-
hasIndex
public boolean hasIndex()
Description copied from interface:StoredFieldReturns whether this field has an index or not.- Specified by:
hasIndexin interfaceStoredField- Returns:
- true if this field has an index.
-
isArray
public boolean isArray()
Description copied from interface:StoredFieldreturns true if the field is an array.- Specified by:
isArrayin interfaceStoredField
-
rename
public void rename(java.lang.String name)
Description copied from interface:StoredFieldmodifies 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:
renamein interfaceStoredField- Parameters:
name- the new name
-
traverseValues
public void traverseValues(Visitor4 visitor)
Description copied from interface:StoredFieldspecialized 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:
traverseValuesin interfaceStoredField- Parameters:
visitor- the visitor to be called with each index value.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-