public abstract class ByteArrayDatabaseEntry extends DatabaseEntryObject
Modifier and Type | Field and Description |
---|---|
protected static int |
TYPE_MASK |
database, isDeleted, locale, modifyingInside, myData
BOOLEAN, BYTE_ARRAY, CREATED_FIELD, DATE, DATE_TIME, DECIMAL, DOUBLE, FIRST_SPECIAL_FIELD, FLAG_SYNCHRONIZED, FLAGS_FIELD, INTEGER, JAVA_OBJECT, LONG, MAX_ID, MODIFIED_BY_FIELD, MODIFIED_FIELD, NAME_FIELD, OBJECT_BYTES_FIELD, OBJECT_TEXT_FIELD, OID_FIELD, OPTION_ERROR_ON_NEED_REINDEX, PLAIN_DATE, PLAIN_TIME, reservedFieldHeaders, reservedFieldIDs, reservedFieldNames, reservedFieldTypes, SORT_DATE_ONLY, SORT_IGNORE_CASE, SORT_TIME_ONLY, SORT_UNKNOWN_IS_GREATER_THAN_KNOWN, SORT_UNKNOWN_IS_LESS_THAN_KNOWN, STRING, TIME, TIMESTAMP
Modifier | Constructor and Description |
---|---|
protected |
ByteArrayDatabaseEntry(DatabaseObject database) |
Modifier and Type | Method and Description |
---|---|
void |
clearDataAndSpecialFields()
Clears the data fields and the special fields.
|
void |
clearField(int fieldID)
Set the specified field to be unassigned.
|
void |
clearFields()
Clears the data fields but not the special fields.
|
int |
compareTo(DatabaseEntry otherEntry,
int[] criteria,
boolean hasWildCards)
Compare this DatabaseEntry to another.
|
int |
countAssignedFields() |
void |
decode(byte[] source,
int offset,
int length,
DataProcessor decryptor)
Decode an encoded DatabaseEntry.
|
protected int |
discoverType(int id) |
ByteArray |
encode(ByteArray destination,
DataProcessor encryptor)
This will place the encoded record data in the destination ByteArray, clearing it first
and possibly encrypting it first (if encryptor is not null).
|
int |
getAssignedFields(int[] dest,
int offset) |
protected ByteArray |
getDataForLoading()
Get the ByteArray that holds the record's encoded data.
|
protected ByteArray |
getDataForSaving()
Get the ByteArray that holds the record's encoded data.
|
Wrapper |
getFieldValue(int id,
int type,
Object destWrapperOrObject)
Get the data stored in a Wrapper.
|
boolean |
hasField(int fieldID) |
protected int |
locateField(int id,
int idType) |
void |
reset()
Compare this object against a set of search objects.
|
void |
setFieldValue(int id,
int type,
Object valueOrWrapper) |
_getSetField, _getSetValue, compareTo, decode, delete, dump, duplicateFrom, encode, erase, fieldToID, fieldToType, getAssignedFields, getData, getData, getDatabase, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getField, getFieldBytes, getFieldInfo, getFieldName, getFieldValue, getFieldValues, getNew, getObjectField, isADeletedEntry, load, markAsDeleted, revert, save, setData, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldValue, setFieldValues, setObjectField, store, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isPointingTo, isSaved, pointTo
protected static final int TYPE_MASK
protected ByteArrayDatabaseEntry(DatabaseObject database)
public void decode(byte[] source, int offset, int length, DataProcessor decryptor) throws IOException
DatabaseEntry
source
- the encoded data bytes.offset
- the start of the data.length
- the number of data bytes.decryptor
- an optional decryptor for decoding.IOException
- if the data is invalid or if the decryptor failed during decryption.protected int locateField(int id, int idType)
public void clearFields()
DatabaseEntry
public void clearField(int fieldID)
DatabaseEntry
public boolean hasField(int fieldID)
public int countAssignedFields()
public int getAssignedFields(int[] dest, int offset)
protected int discoverType(int id)
discoverType
in class DatabaseEntryObject
public void clearDataAndSpecialFields()
DatabaseEntry
public void setFieldValue(int id, int type, Object valueOrWrapper)
public Wrapper getFieldValue(int id, int type, Object destWrapperOrObject)
DatabaseEntry
getFieldValue
in interface DatabaseEntry
getFieldValue
in class DatabaseEntryObject
id
- the field ID.type
- the expected type of the field.destWrapperOrObject
- this can be a destination Wrapper, which itself
may have a destination object already set, or it can be a destination Object
itself. The destination Object is NOT used for primitive types such as INTEGER, LONG,
DOUBLE or BOOLEAN, but a destination Wrapper can be used. The acceptable destination objects for other types are:
BYTE_ARRAY - eve.util.ByteArray STRING - eve.util.CharArray PLAIN_DATE - eve.data.PlainDate PLAIN_TIME - eve.data.PlainTime DATE_TIME - eve.sys.Time DATE - eve.sys.DayOfYear TIME - eve.sys.TimeOfDay DECIMAL - eve.sys.Decimal TIMESTAMP - eve.database.TimeStamp
public ByteArray encode(ByteArray destination, DataProcessor encryptor) throws IOException
destination
- The destination for the data. If it is null a new one will be created.encryptor
- An optional encryptor for the data.IOException
- if there is an error encrypting the data.public int compareTo(DatabaseEntry otherEntry, int[] criteria, boolean hasWildCards)
criteria
- a list of criteria (as returned by toCriteria(field,type,options)).public void reset()
reset
in interface DatabaseEntry
reset
in class DatabaseEntryObject
searchObject
- a list of searchObjects, each of which
must have been created using toSearchObject().protected ByteArray getDataForSaving()
protected ByteArray getDataForLoading()