|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ksu.cis.projects.bogor.module.value.DefaultRecordValue
public class DefaultRecordValue
The default implementation of IRecordValue.
| Field Summary | |
|---|---|
protected IValueArray |
fieldValues
Holds the field values of this record. |
protected ILockValue |
lockValue
Holds the lock value of this record value. |
protected int |
referenceId
Holds the reference id of this record. |
protected RecordType |
type
The record type of this record value. |
protected IValueFactory |
vf
Holds the value factory of this record value. |
| Constructor Summary | |
|---|---|
protected |
DefaultRecordValue()
Private constructor for cloning purposes. |
protected |
DefaultRecordValue(IValueFactory vf,
int referenceId,
RecordType type,
IValueArray fieldValues,
ILockValue lockValue)
Default constructor. |
| Method Summary | |
|---|---|
IRecordValue |
clone(Map<Object,Object> cloneMap)
Override to specialize return type |
int |
compareTo(IValue o)
|
void |
dispose()
Remove references. |
boolean |
equals(Object o)
Classes implementing IValue should provide their own
equality tests. |
int |
getFieldCount()
Gets the number of fields in this record. |
IValue |
getFieldValue(int fieldIndex)
Gets a record field's value. |
IValueArray |
getFieldValues()
|
ILockValue |
getLockValue()
Gets the lock value of this record. |
int |
getReferenceId()
Gets this non-primitive value reference id. |
Type |
getType()
Gets the type of this value. |
int |
getTypeId()
Gets the type id of this value. |
int |
hashCode()
Classes implementing IValue should provide their own
hashing method. |
byte[][] |
linearize(int bitsPerNonPrimitiveValue,
ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap,
int bitsPerThreadId,
IntIntTable threadOrderMap)
Linearizes this record value. |
void |
setFieldValue(int fieldIndex,
IValue fieldValue)
Sets a record field's value. |
String |
toString()
Gets the string representation of this value. |
String |
toVerboseString()
Gets the verbose string representation of this record. |
void |
validate(IBogorConfiguration bc)
Freshen references to Bogor model checking components and other non-serializable objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient IValueFactory vf
protected RecordType type
protected IValueArray fieldValues
protected ILockValue lockValue
protected int referenceId
| Constructor Detail |
|---|
protected DefaultRecordValue(IValueFactory vf,
int referenceId,
RecordType type,
IValueArray fieldValues,
ILockValue lockValue)
vf - The value factory of this lock value. Must be non-null.referenceId - The reference id for this record value. Must be greater than
0.type - The record type for this record value. Must be non-null.fieldValues - The field values for this record value. Must be non-null.lockValue - The lock value for this record value. Must be non-null.RecordType.getFieldIndex(String)protected DefaultRecordValue()
| Method Detail |
|---|
public int getFieldCount()
IRecordValue
getFieldCount in interface IRecordValue
public void setFieldValue(int fieldIndex,
IValue fieldValue)
IRecordValue
setFieldValue in interface IRecordValuefieldIndex - The index of the field in this record. Must be greater than
zero and less than the field count of this record.fieldValue - The new value of the field. Must be non-null.RecordType.getFieldIndex(String)public IValue getFieldValue(int fieldIndex)
IRecordValue
getFieldValue in interface IRecordValuefieldIndex - The index of the field in this record. Must be greater than
zero and less than the field count of this record.
RecordType.getFieldIndex(String)public IValueArray getFieldValues()
getFieldValues in interface IRecordValuepublic ILockValue getLockValue()
IRecordValue
getLockValue in interface IRecordValuepublic int getReferenceId()
INonPrimitiveValue
getReferenceId in interface INonPrimitiveValuepublic Type getType()
IValue
getType in interface IValueType.getTypeId()public int getTypeId()
IValue
getTypeId in interface IValueType.getTypeId()public IRecordValue clone(Map<Object,Object> cloneMap)
INonPrimitiveValue
clone in interface INonPrimitiveValueclone in interface IRecordValueclone in interface IValuecloneMap - Original values (IValue) to their clones (
IValue) mapping. The clone map to solve
circular references in values. If this value is a key in the
map, then this method returns the value of the key in the map.
Must be non-null.
public int compareTo(IValue o)
compareTo in interface Comparable<IValue>public void dispose()
Disposable
dispose in interface Disposablepublic boolean equals(Object o)
IValueIValue should provide their own
equality tests.
equals in interface IValueequals in class Objectpublic int hashCode()
IValueIValue should provide their own
hashing method.
hashCode in interface IValuehashCode in class Object
public byte[][] linearize(int bitsPerNonPrimitiveValue,
ObjectIntTable<INonPrimitiveValue> nonPrimitiveValueIdMap,
int bitsPerThreadId,
IntIntTable threadOrderMap)
IRecordValue
linearize in interface IRecordValuebitsPerNonPrimitiveValue - The number of bits used to encode a non-primitive value.nonPrimitiveValueIdMap - A mapping of non-primitive values to their unique id. Must be
non-null.bitsPerThreadId - The number of bits used to encode a thread descriptor.threadOrderMap - A mapping of thread descriptors to their order number. Must be
non-null.
public String toString()
IValue
toString in interface IValuetoString in class Objectpublic String toVerboseString()
IRecordValue
toVerboseString in interface IRecordValuepublic void validate(IBogorConfiguration bc)
IValueFreshen references to Bogor model checking components and other non-serializable objects. Generally, this can be done in a few steps:
Model checking components (IModule implementations) should be
reacquired by fetching them from the parameter,
bc:
valueFactory = bc.getValueFactory();
scheduler = bc.getSchedulingStrategist();
Any fields storing Type objects should be treated as stale, but
still uniquely identifier by their integer typeId field. This
can be used as a key to look up the correct Type instances in the
new symbol table's typeId-to-type table:
typeField = bc.getSymbolTable().getTypeIdTypeTable().get(typeField.getTypeId());
Any IValueArray objects contained can simply be "chained" by
their IValueArray.validate(IBogorConfiguration) method:
someValueArray.validate(bc);
IValue objects contained directly should not be handled
manually by this method; they will be dealt with directly when they are visited
later
validate in interface IValuebc - The Bogor configuration to validate to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||