com.azalient.api.file.record
Class AbstractStoreRecordIndirectName

java.lang.Object
  extended by com.azalient.api.file.record.TypeObject
      extended by com.azalient.api.file.record.ReaderUtilities
          extended by com.azalient.api.file.record.AbstractRecordR
              extended by com.azalient.api.file.record.AbstractRecordRW
                  extended by com.azalient.api.file.record.AbstractStoreRecordIndirectName
All Implemented Interfaces:
IRecord, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW

public abstract class AbstractStoreRecordIndirectName
extends AbstractRecordRW
implements StoreRecordRW

An abstract implementation of the RecordRW interface, creating a read-write record whose name is derived indirectly, often from other objects. For example, the name of a lane is derived from the name of the link to which it belongs and its index in that links array of lanes.


Field Summary
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Constructor Summary
AbstractStoreRecordIndirectName(IStore aStore)
          Create a record with an indirect name.
 
Method Summary
 boolean canRename()
          Returns true if this record can be renamed.
abstract  String indirectName()
           
 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 s)
          Rename this record, if that is possible.
 IStore store()
          The store to which this record belongs.
 
Methods inherited from class com.azalient.api.file.record.AbstractRecordRW
extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile, set
 
Methods inherited from class com.azalient.api.file.record.AbstractRecordR
extraCols, extraSet, finished, isApplicable, isEditable, toString
 
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable, set
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile
 

Constructor Detail

AbstractStoreRecordIndirectName

public AbstractStoreRecordIndirectName(IStore aStore)
Create a record with an indirect name. The concrete implementaiton of this class must supply the method for indirectName()

Method Detail

store

public IStore store()
Description copied from interface: StoreRecordRW
The store to which this record belongs. This many be null in some cases.

Specified by:
store in interface StoreRecordRW

indirectName

public abstract String indirectName()

canRename

public final 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

rename

public final void rename(String s)
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

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