|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectVariableImpl
FiniteVariableImpl
public class FiniteVariableImpl
A class for representing finite variables. It consists of a name as well as a list of possible values.
Field Summary |
---|
Fields inherited from class VariableImpl |
---|
id, INT_NUM_PROPERTIES, theCollator, userobject |
Constructor Summary | |
---|---|
FiniteVariableImpl(FiniteVariable toCopy)
|
|
FiniteVariableImpl(FiniteVariable toCopy,
DSLNodeType type,
CPTShell shell)
|
|
FiniteVariableImpl(String id,
List instances)
|
|
FiniteVariableImpl(String id,
Object[] instances)
Creates a new Finite variable. |
Method Summary | |
---|---|
Object |
clone()
|
boolean |
contains(Object instance)
|
static FiniteVariableImpl |
debugInstance()
|
static Map |
deepCloneMapTypesToShells(FiniteVariable toCopy)
|
static Collection |
findVariablesForType(Collection bn,
DSLNodeType target,
Collection ret)
moved from DSLNodeType 20081110 |
CPTShell |
getCPTShell()
|
CPTShell |
getCPTShell(DSLNodeType type)
|
DSLNodeType |
getDSLNodeType()
moved from DSLNode 010905 |
int |
grep(Filter filter,
Collection results)
|
int |
grep(Matcher matcher,
boolean invert,
Collection results)
|
int |
grep(Pattern pattern,
boolean invert,
Collection results)
|
int |
index(Object instance)
Returns the index associated with the instance. |
boolean |
insert(int index,
Object instance)
|
Object |
instance(int index)
Returns the instance associated with the index. |
Object |
instance(String name)
Returns the instance represented by the string. |
List |
instances()
|
Object |
remove(int index)
|
Object |
set(int index,
Object objNew)
|
void |
setCPTShell(CPTShell shell)
Deprecated. |
void |
setCPTShell(DSLNodeType type,
CPTShell shell)
|
void |
setDSLNodeType(DSLNodeType newVal)
moved from DSLNode 010905 |
int |
size()
Returns the number of possible values. |
static long |
size(Collection vars)
Returns the number of instantiations of the collection of variables. |
static FiniteVariable |
thereExists(Collection bn,
DSLNodeType target)
moved from DSLNodeType 20081110 |
String |
toString()
|
Methods inherited from class VariableImpl |
---|
compareTo, delete, forID, getEnumProperties, getID, getNumProperties, getProperty, getStringifier, getUserObject, index, initProperties, isStringifier, propertiesArrayCopy, setID, setProperty, setStringifier, setUserObject, validatePropertyNameAndID |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface Variable |
---|
delete, getEnumProperties, getID, getProperty, getUserObject, setID, setProperty, setUserObject |
Methods inherited from interface Comparable |
---|
compareTo |
Constructor Detail |
---|
public FiniteVariableImpl(String id, Object[] instances)
name
- the name the Variable will be known by.instances
- the list of instances this variable can take on. These may be of
any type.public FiniteVariableImpl(String id, List instances)
public FiniteVariableImpl(FiniteVariable toCopy)
public FiniteVariableImpl(FiniteVariable toCopy, DSLNodeType type, CPTShell shell)
Method Detail |
---|
public int grep(Filter filter, Collection results)
grep
in interface FiniteVariable
results
- accumulate matches
public int grep(Pattern pattern, boolean invert, Collection results)
grep
in interface FiniteVariable
invert
- invert the sense of the grep, i.e. add non-matchesresults
- accumulate matches
public int grep(Matcher matcher, boolean invert, Collection results)
grep
in interface FiniteVariable
invert
- invert the sense of the grep, i.e. add non-matchesresults
- accumulate matches
public static Map deepCloneMapTypesToShells(FiniteVariable toCopy)
public Object clone()
clone
in interface Variable
clone
in class VariableImpl
public List instances()
instances
in interface FiniteVariable
public Object set(int index, Object objNew)
set
in interface FiniteVariable
public boolean insert(int index, Object instance)
insert
in interface FiniteVariable
public Object remove(int index)
remove
in interface FiniteVariable
public CPTShell getCPTShell()
getCPTShell
in interface FiniteVariable
public void setCPTShell(CPTShell shell)
setCPTShell
in interface FiniteVariable
public CPTShell getCPTShell(DSLNodeType type)
getCPTShell
in interface FiniteVariable
public void setCPTShell(DSLNodeType type, CPTShell shell)
setCPTShell
in interface FiniteVariable
public DSLNodeType getDSLNodeType()
FiniteVariable
getDSLNodeType
in interface FiniteVariable
public void setDSLNodeType(DSLNodeType newVal)
FiniteVariable
setDSLNodeType
in interface FiniteVariable
public static Collection findVariablesForType(Collection bn, DSLNodeType target, Collection ret)
public static FiniteVariable thereExists(Collection bn, DSLNodeType target)
public int size()
size
in interface FiniteVariable
public Object instance(int index)
instance
in interface FiniteVariable
public Object instance(String name)
instance
in interface FiniteVariable
instance
in interface Variable
public int index(Object instance)
index
in interface FiniteVariable
public boolean contains(Object instance)
contains
in interface FiniteVariable
public String toString()
toString
in class Object
public static long size(Collection vars)
public static FiniteVariableImpl debugInstance()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |