shout3d.core
Class NodeArrayField
java.lang.Object
|
+--shout3d.core.Field
|
+--shout3d.core.ArrayField
|
+--shout3d.core.NodeArrayField
- public class NodeArrayField
- extends ArrayField
A Field whose value stores an array of Nodes.
Constructor Summary |
NodeArrayField(Node owner,
java.lang.String name,
int usage,
Node[] value)
Constructs a new NodeArrayField. |
Method Summary |
int |
getLength()
Returns the number of elements in the array of values. |
Node[] |
getValue()
Returns the current value of the field as a reference to the array. |
boolean |
isRecursivelySearchable()
Returns whether node values in this field are recursively
searched by searchers. |
void |
set1Value(int index,
Node newVal)
Sets a single value in the array from the input newVal. |
void |
setRecursivelySearchable(boolean newVal)
Sets whether node values in this field should be recursively
searched by searchers. |
void |
setValue(Node[] newVal)
Sets the value of the field from the input argument. |
Methods inherited from class shout3d.core.Field |
addFieldObserver,
addRoute,
deleteRoute,
fieldNotify,
getName,
getNumRoutes,
getOwner,
getRoutedField,
getTypeName,
getUsage,
getValueByString,
isOfType,
isRouted,
removeFieldObserver,
setValueByString |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
NodeArrayField
public NodeArrayField(Node owner,
java.lang.String name,
int usage,
Node[] value)
- Constructs a new NodeArrayField.
- Parameters:
owner
- this Field's ownername
- this Field's nameusage
- this Field's usagevalue
- this Field's value
getLength
public int getLength()
- Returns the number of elements in the array of values.
- Overrides:
- getLength in class ArrayField
set1Value
public void set1Value(int index,
Node newVal)
throws Shout3DException
- Sets a single value in the array from the input newVal. If the specified
index is out of range, throws a Shout3DException. Otherwise, sets the
value and notifies all registered FieldObservers.
- Parameters:
index
- the index of the element in the array to be setnewVal
- the new value for the given element of the field
setValue
public void setValue(Node[] newVal)
- Sets the value of the field from the input argument. Does not
create a copy of the input, but refers to the same array in memory.
Following this, notifies all registered FieldObservers.
- Parameters:
newVal
- the new value for the field
getValue
public Node[] getValue()
- Returns the current value of the field as a reference to the array.
Returns a reference to the actual value of the field, not a copy.
If an application changes the data, it must notify the field by
making a subsequent call to setValue.
- Returns:
- the reference to the value.
setRecursivelySearchable
public void setRecursivelySearchable(boolean newVal)
- Sets whether node values in this field should be recursively
searched by searchers.
For example, if this is set to true and the value of the field is a
Group node, then when this field is searched, the children field of the
Group will be searched as well.
- Parameters:
newVal
- whether the node values should be recursively searched
isRecursivelySearchable
public boolean isRecursivelySearchable()
- Returns whether node values in this field are recursively
searched by searchers.
For example, if this method returns true and the value of the field is a
Group node, then when this field is searched, the children field of the
Group will be searched as well.
- Returns:
- whether the node values are recursively searched