|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ksu.cis.projects.bogor.module.event.AbstractEventProvider
edu.ksu.cis.projects.bogor.module.value.event.AbstractValueEventProvider
edu.ksu.cis.projects.bogor.module.value.DefaultValueFactory
public class DefaultValueFactory
The default implementation of IValueFactory.
| Field Summary | |
|---|---|
protected IBogorConfiguration |
bc
Holds the Bogor configuration. |
protected static String |
defaultValueFunction
|
protected int |
elementsInRegion
|
protected DefaultNullValue |
nullValue
Holds the unique null value. |
protected SymbolTable |
symbolTable
Holds the symbol table. |
protected TypeFactory |
tf
Holds the type factory. |
protected IValueFactory |
vf
Holds the value factory (for delegation). |
| Fields inherited from class edu.ksu.cis.projects.bogor.module.value.event.AbstractValueEventProvider |
|---|
dvenBackward, dvenForward |
| Fields inherited from class edu.ksu.cis.projects.bogor.module.event.AbstractEventProvider |
|---|
isForward, s, threadId |
| Constructor Summary | |
|---|---|
DefaultValueFactory()
Default constructor. |
|
| Method Summary | |
|---|---|
IMessageStore |
connect(IBogorConfiguration bc)
Connects this modules to other modules. |
IValue |
createDefaultValue(Type type)
Creates a default value of a type. |
void |
dispose()
Remove references. |
String |
getCopyrightNotice()
Returns the copyright notice for this module. |
Pair<Domain,Boolean> |
getOptionDomain(String id)
|
Collection<Triple<String,Boolean,OptionScope>> |
getOptionIds()
|
int |
getReferenceIdSeed()
Gets the reference id seed. |
Collection<String> |
getSuggestedValues(String id,
IBogorConfiguration bc,
SymbolTable st)
|
Type |
getType(IValue value)
Gets the type of a value. |
IArrayValue |
newArrayValue(ArrayType arrayType,
Type[] fieldTypes,
int[] lengths)
Creates an array value. |
IDoubleValue |
newDoubleValue(double d)
Creates a double value. |
IExpASTValue |
newExpASTValue(Exp exp)
Creates an exp AST value. |
IFloatValue |
newFloatValue(float f)
Creates a float value. |
IIntValue |
newIntValue(int integer)
Creates an integer value. |
IIntValue |
newIntValue(Type type,
int integer)
Creates an integer value. |
ILockValue |
newLockValue()
Creates a new lock value. |
ILongValue |
newLongValue(long l)
Creates a long value. |
ILongValue |
newLongValue(LongType type,
long l)
Creates an integer value. |
INullValue |
newNullValue()
Creates a new null value. |
IRecordValue |
newRecordValue(RecordType recordType)
Creates a new record value. |
int |
newReferenceId()
Generates a new reference id. |
IStringValue |
newStringValue(String s)
Creates a string value. |
IValueArray |
newUniformValueArray(IValue[] values)
Creates a value array from an array of values. |
IValueArray |
newVariedValueArray(IValue[] values)
Creates a value array from an array of values. |
protected IValue |
recurseNewArrayValue(ArrayType arrayType,
Type[] fieldTypes,
int[] lengths,
int i)
Creates an array value given for each dimension's length. |
IMessageStore |
setOptions(String key,
Properties configuration)
Sets the options for this module. |
void |
setReferenceIdSeed(int newSeed)
Sets the reference id seed. |
void |
validate(IValue value)
Validates a value. |
void |
validate(IValueArray valueArray)
Validates a value array. |
boolean |
validate(String id,
String value,
IBogorConfiguration bc,
SymbolTable st,
Collection<FileMessage> errors)
Checks whether the value of a configuration option is legal. |
| Methods inherited from class edu.ksu.cis.projects.bogor.module.value.event.AbstractValueEventProvider |
|---|
getNotifier, getNotifier |
| Methods inherited from class edu.ksu.cis.projects.bogor.module.event.AbstractEventProvider |
|---|
backward, forward, getState, getThreadId, isBackward, isForward, removeContext, setContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface edu.ksu.cis.projects.bogor.module.value.event.IValueEventProvider |
|---|
getNotifier, getNotifier |
| Methods inherited from interface edu.ksu.cis.projects.bogor.module.event.IEventProvider |
|---|
backward, forward, getState, getThreadId, isBackward, isForward, removeContext, setContext |
| Field Detail |
|---|
protected static final String defaultValueFunction
protected DefaultNullValue nullValue
protected SymbolTable symbolTable
protected TypeFactory tf
protected IValueFactory vf
protected IBogorConfiguration bc
protected int elementsInRegion
| Constructor Detail |
|---|
public DefaultValueFactory()
| Method Detail |
|---|
public String getCopyrightNotice()
IModule
getCopyrightNotice in interface IModule
public IMessageStore setOptions(String key,
Properties configuration)
IModule
setOptions in interface IModulekey - The key (prefix) for this module options. Must be non-null.
The key is used for module specific options.configuration - The options for all modules. Must be non-null.public void setReferenceIdSeed(int newSeed)
IValueFactory
setReferenceIdSeed in interface IValueFactorynewSeed - The new seed.public int getReferenceIdSeed()
IValueFactory
getReferenceIdSeed in interface IValueFactorypublic Type getType(IValue value)
IValueFactory
getType in interface IValueFactoryvalue - The value whose type to be retrieved.
Must be non-null.
public IMessageStore connect(IBogorConfiguration bc)
IModule
connect in interface IModulebc - The Bogor configuration containing modules to connect to.
Must be non-null.public IValue createDefaultValue(Type type)
IValueFactory
createDefaultValue in interface IValueFactorytype - The type whose default value to be created.
If the type is a range type that does not include zero in its range,
then the low limit of the range type is the default value.
Must be either a primitive type or a non-primitive type.
public void dispose()
Disposable
dispose in interface Disposable
public IArrayValue newArrayValue(ArrayType arrayType,
Type[] fieldTypes,
int[] lengths)
IValueFactory
newArrayValue in interface IValueFactoryarrayType - The array type whose value to be created.fieldTypes - The array fields' types. Must be non-null.
Each element must be non-null.lengths - The lengths of dimensions of the new array.
The number of lenghts must be at most equal to the array rank.
Must contain at least one element.
Each length must be at least zero.
public IDoubleValue newDoubleValue(double d)
IValueFactory
newDoubleValue in interface IValueFactoryd - The double of the double value.
public IExpASTValue newExpASTValue(Exp exp)
IValueFactory
newExpASTValue in interface IValueFactoryexp - The exp AST of the exp AST value. Must be non-null.
public IFloatValue newFloatValue(float f)
IValueFactory
newFloatValue in interface IValueFactoryf - The float of the float value.
public IIntValue newIntValue(Type type,
int integer)
IValueFactory
newIntValue in interface IValueFactorytype - The type of this integer.
Must be instance of IntType or BooleanType.integer - The integer of this integer value.
public IIntValue newIntValue(int integer)
IValueFactory
newIntValue in interface IValueFactoryinteger - The integer of the integer value.
IntType as its type. Non-null.public ILockValue newLockValue()
IValueFactory
newLockValue in interface IValueFactory
public ILongValue newLongValue(LongType type,
long l)
IValueFactory
newLongValue in interface IValueFactorytype - The type of the long value. Must be non-null.l - The long of the long value.
public ILongValue newLongValue(long l)
IValueFactory
newLongValue in interface IValueFactoryl - The long of the long value.
LongType as its type. Non-null.public INullValue newNullValue()
IValueFactory
newNullValue in interface IValueFactorypublic IRecordValue newRecordValue(RecordType recordType)
IValueFactory
newRecordValue in interface IValueFactoryrecordType - The record type whose value to be created.
Must be non-null.
public int newReferenceId()
IValueFactory
newReferenceId in interface IValueFactorypublic IStringValue newStringValue(String s)
IValueFactory
newStringValue in interface IValueFactorys - The string of the string value. Must be non-null.
public IValueArray newUniformValueArray(IValue[] values)
IValueFactory
newUniformValueArray in interface IValueFactoryvalues - The array of values. Must be non-null.
Each element must be non-null. Each element must be of the same type.
public IValueArray newVariedValueArray(IValue[] values)
IValueFactory
newVariedValueArray in interface IValueFactoryvalues - The array of values. Must be non-null.
Each element must be non-null.
public void validate(IValue value)
IValueFactory
validate in interface IValueFactoryvalue - The value to be validated.
Must be non-null.public void validate(IValueArray valueArray)
IValueFactory
validate in interface IValueFactoryvalueArray - The value array to be validated.
Must be non-null.
protected IValue recurseNewArrayValue(ArrayType arrayType,
Type[] fieldTypes,
int[] lengths,
int i)
arrayType - The array type for the new array value. Non-null.fieldTypes - The field types of an array types.
Non-null. Each element is non-null.lengths - The array that contains the length of each dimension.
At least one element. Each element must be at least zero.i - The current dimension to create. At most equal to rank. At least zero.public Collection<Triple<String,Boolean,OptionScope>> getOptionIds()
getOptionIds in interface ISelfDescribingModuleedu.ksu.cis.projects.bogor.module.ISearcher)
or global in scope (and thus no qualifier is prepended).public Pair<Domain,Boolean> getOptionDomain(String id)
getOptionDomain in interface ISelfDescribingModule
public Collection<String> getSuggestedValues(String id,
IBogorConfiguration bc,
SymbolTable st)
getSuggestedValues in interface ISelfDescribingModule
public boolean validate(String id,
String value,
IBogorConfiguration bc,
SymbolTable st,
Collection<FileMessage> errors)
ISelfDescribingModule
validate in interface ISelfDescribingModuleid - the option's name, as returned by the first tuple element of
an item returned by ISelfDescribingModule.getOptionIds()value - the value of the option, or null if unconfiguedst - the symbol table for the BIR modelerrors - a container into which errors should be put. Implementors
should not assume that errors is empty upon
entry into this method; it may aggregate the results of
calling validate on many
ISelfDescribingModule instances.
true iff the option is supported and its value is legal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||