|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<java.lang.Object,Value>
clarion.system.Dimension
public final class Dimension
This class implements a dimension within CLARION. It extends the LinkedHashMap class.
Usage:
A dimension is a somewhat meaningless thing unless it is filled with values. A coupling of a dimension and a value together is called a dimension-value pair and is the base unit in CLARION for representing information.
Examples of dimension-value pairs:
Field Summary | |
---|---|
private int |
hash
The hash for this object. |
private java.lang.Object |
ID
Identifies the dimension. |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
Dimension(java.lang.Object id)
Initializes the dimension and sets the ID of the dimension to the ID specified. |
|
Dimension(java.lang.Object id,
java.util.Collection<? extends Value> vals)
Initializes the dimension with the specified ID and collection of values. |
|
Dimension(java.lang.Object id,
java.util.Map<? extends java.lang.Object,? extends Value> map)
Initializes the dimension with the specified ID and map of values. |
Method Summary | |
---|---|
boolean |
checkMatchAll()
Checks to see if all of the values in a specified dimension are activated. |
Dimension |
clone()
Clones the dimension (including all of it's Values). |
boolean |
equals(java.lang.Object dim)
Checks to see if the specified object is a dimension and if the ID of the specified dimension is the same as this dimension. |
boolean |
equalsID(java.lang.Object dim)
Checks to see if the specified dimension has the same ID as this dimension. |
java.lang.Object |
getID()
Gets the ID of this dimension. |
double |
getMaxActivation()
Gets the activation level of the value with the highest activation in this dimension. |
int |
getNumActivatedVals()
Gets the number of values in this dimension that are at least minimally activated. |
int |
getNumFullyActivatedVals()
Gets the number of fully activated values in this dimension. |
int |
hashCode()
|
Value |
put(java.lang.Object key,
Value val)
Puts the value in the dimension as long as the value is not already in the dimension. |
void |
putAll(java.util.Map<? extends java.lang.Object,? extends Value> map)
Puts all of the values in the map into the dimension as long as the values are not already in the dimension. |
int |
size()
Returns the number of values in the dimension. |
java.lang.String |
toString()
|
Methods inherited from class java.util.LinkedHashMap |
---|
clear, containsValue, get, removeEldestEntry |
Methods inherited from class java.util.HashMap |
---|
containsKey, entrySet, isEmpty, keySet, remove, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
containsKey, entrySet, isEmpty, keySet, remove, values |
Field Detail |
---|
private static final long serialVersionUID
private java.lang.Object ID
private int hash
Constructor Detail |
---|
public Dimension(java.lang.Object id)
id
- The ID of the dimension.public Dimension(java.lang.Object id, java.util.Collection<? extends Value> vals)
id
- The ID of the dimension.vals
- The values for the dimension.public Dimension(java.lang.Object id, java.util.Map<? extends java.lang.Object,? extends Value> map)
id
- The ID of the dimension.map
- The map of values for the dimension.Method Detail |
---|
public java.lang.Object getID()
public int getNumFullyActivatedVals()
public int getNumActivatedVals()
public boolean checkMatchAll()
public double getMaxActivation()
public Value put(java.lang.Object key, Value val) throws java.lang.IllegalArgumentException
put
in interface java.util.Map<java.lang.Object,Value>
put
in class java.util.HashMap<java.lang.Object,Value>
key
- The key with which the specified value is to be associated. This MUST be the ID
of the specified value.val
- The value to add to the dimension.
java.lang.IllegalArgumentException
- If the value is already in the dimension or the specified key
is not the ID of the specified value.public void putAll(java.util.Map<? extends java.lang.Object,? extends Value> map)
putAll
in interface java.util.Map<java.lang.Object,Value>
putAll
in class java.util.HashMap<java.lang.Object,Value>
map
- The map of values to add.
java.lang.IllegalArgumentException
- If any values are already in the dimension or any of the
specified keys are not the ID of their respective value.public boolean equalsID(java.lang.Object dim)
dim
- The dimension whose ID you want to compare to this dimension's ID.
public boolean equals(java.lang.Object dim)
equals
in interface java.util.Map<java.lang.Object,Value>
equals
in class java.util.AbstractMap<java.lang.Object,Value>
dim
- The object to compare to this dimension.
public int hashCode()
hashCode
in interface java.util.Map<java.lang.Object,Value>
hashCode
in class java.util.AbstractMap<java.lang.Object,Value>
public Dimension clone()
clone
in class java.util.HashMap<java.lang.Object,Value>
public int size()
size
in interface java.util.Map<java.lang.Object,Value>
size
in class java.util.HashMap<java.lang.Object,Value>
public java.lang.String toString()
toString
in class java.util.AbstractMap<java.lang.Object,Value>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |