com.azalient.api.file.record
Class AbstractStoreRecordFixedName
java.lang.Object
com.azalient.api.file.record.TypeObject
com.azalient.api.file.record.ReaderUtilities
com.azalient.api.file.record.AbstractRecordR
com.azalient.api.file.record.AbstractRecordRW
com.azalient.api.file.record.AbstractStoreRecordFixedName
- All Implemented Interfaces:
- IRecord, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW
public abstract class AbstractStoreRecordFixedName
- extends AbstractRecordRW
- implements StoreRecordRW
An abstract implementation of a record with a fixed name that never changes, either by user intervention or
by a change of name of the owning object
|
Method Summary |
boolean |
canRename()
Returns true if this record can be renamed. |
String |
name()
This is a string representation of the key field(s), used as a key for looking up the object in the Store. |
void |
rename(String newName)
Rename this record, if that is possible. |
IStore |
store()
This always returns null - this type of record does not keep a record of the store, even if the record can be kept in a store, because
the record cannot be renamed, and therefore never needs to be rehashed. |
| Methods inherited from class com.azalient.api.file.record.TypeObject |
b, c, d, equals, equals, equalsEW, f, i, keyString, keyString, nameFromKeyString, rowKeysFromKeyString, s, t, t |
AbstractStoreRecordFixedName
public AbstractStoreRecordFixedName(String name)
- The final (fixed) name of the object must be passed in. Use a static newXXX
factory method if the name is constructed from another object that would be passed in
store
public IStore store()
- This always returns null - this type of record does not keep a record of the store, even if the record can be kept in a store, because
the record cannot be renamed, and therefore never needs to be rehashed.
- Specified by:
store in interface StoreRecordRW
name
public final String name()
- Description copied from interface:
IRecord
- This is a string representation of the key field(s), used as a key for looking up the object in the Store.
If there is more than one key field, the string representation of the key fields are concatenated, separated by KEY_SEP.
See TypeObject.keyString(Object[])
If there are multiple key fields, the get() function should not return the concatenated name,
but the name function must be defined in the object so that the lookup function can use it.
- Specified by:
name in interface IRecord
rename
public final void rename(String newName)
- Description copied from interface:
StoreRecordRW
- Rename this record, if that is possible. If it is not possible an error will be generated, so if you are not
sure, check first using
StoreRecordRW.canRename()
- Specified by:
rename in interface StoreRecordRW
canRename
public boolean canRename()
- Description copied from interface:
StoreRecordRW
- Returns true if this record can be renamed. Renaming must update the hash table, as all records are indexed by their name.
Some types of record have indirect names, based on associated objects, and cannot be renamed directly.
- Specified by:
canRename in interface StoreRecordRW