Package org.web3d.x3d.jsail.fields
Class SFNodeObject
java.lang.Object
org.web3d.x3d.jsail.fields.X3DConcreteField
org.web3d.x3d.jsail.fields.SFNodeObject
public class SFNodeObject extends X3DConcreteField implements SFNode
This utility class provides a concrete implementation corresponding to SFNode X3D field type.
Package hint: This specification class is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). SFNode specifies an X3D node; the default empty value of an uninitialized SFNode field is sometimes described as NULL.
Related field object:
Package hint: This specification class is defined by the X3D Java Language Binding Specification for the Scene Authoring Interface (SAI). SFNode specifies an X3D node; the default empty value of an uninitialized SFNode field is sometimes described as NULL.
Related field object:
MFNodeObject
-
Field Summary
Fields Modifier and Type Field Description static X3DNode
DEFAULT_VALUE
Default value for this field type is a null node.static java.lang.String
DEFAULT_VALUE_STRING
Default string value for this field type is "".static java.lang.String
NAME
String constant NAME provides name of this element: SFNodestatic int
TUPLE_SIZE
Default tuple size for this field type is 1 (i.e. number of component values making up a single-field SF object). -
Constructor Summary
Constructors Constructor Description SFNodeObject()
Constructor for SFNodeObject performs value initialization.SFNodeObject(SFNodeObject newValue)
Constructor to copy an SFNodeObject value as initial value for this new field object.SFNodeObject(X3DNode newValue)
Constructor for SFNodeObject using a corresponding Java primitive X3DNode as new initial value. -
Method Summary
Modifier and Type Method Description SFNodeObject
clearChildren()
Utility method to clear all contained children including nodes, statements and comments (if any).X3DNode
getPrimitiveValue()
Provides current value of the field as a Java primitive type.X3DNode
getValue()
Get the current value.void
initialize()
Initialization for SFNodeObject applies default initial value.static boolean
isArray()
Whether or not this field type is an array (false)boolean
isDefaultValue()
Determine whether current value matches DEFAULT_VALUESFNodeObject
setValue(SFNodeObject newValue)
Apply an SFNodeObject value to this field.void
setValue(X3DNode newValue)
Assign a new value to this field.java.lang.String
toString()
Provides current value as a String.static java.lang.String
toString(X3DNode value)
Static utility method to provide String representation of a correctly typed input value.Methods inherited from class org.web3d.x3d.jsail.fields.X3DConcreteField
addX3DEventListener, getDefinition, getTupleSize, getValidationResult, isReadable, isWritable, removeX3DEventListener, setReadable, setWritable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.web3d.x3d.sai.X3DField
addX3DEventListener, getDefinition, isReadable, isWritable, removeX3DEventListener
-
Field Details
-
NAME
public static final java.lang.String NAMEString constant NAME provides name of this element: SFNode- See Also:
- Constant Field Values
-
DEFAULT_VALUE
Default value for this field type is a null node.- See Also:
- Java Tutorials: Primitive Data Types
-
DEFAULT_VALUE_STRING
public static final java.lang.String DEFAULT_VALUE_STRINGDefault string value for this field type is "".- See Also:
- Constant Field Values
-
TUPLE_SIZE
public static final int TUPLE_SIZEDefault tuple size for this field type is 1 (i.e. number of component values making up a single-field SF object).- See Also:
- Constant Field Values
-
-
Constructor Details
-
SFNodeObject
public SFNodeObject()Constructor for SFNodeObject performs value initialization. -
SFNodeObject
Constructor to copy an SFNodeObject value as initial value for this new field object.- Parameters:
newValue
- The newValue to apply
-
SFNodeObject
Constructor for SFNodeObject using a corresponding Java primitive X3DNode as new initial value.- Parameters:
newValue
- is new value to assign setContainerFieldOverride(containerFieldName); // apply checksConcreteField#getTupleSize(String)
-
-
Method Details
-
isArray
public static final boolean isArray()Whether or not this field type is an array (false)- Returns:
- true if array type
-
initialize
public final void initialize()Initialization for SFNodeObject applies default initial value.- Specified by:
initialize
in classX3DConcreteField
- See Also:
DEFAULT_VALUE
-
toString
Static utility method to provide String representation of a correctly typed input value.- Parameters:
value
- The value to convert to a String- Returns:
- String version of the provided value
- See Also:
- X3D Tooltips: type
-
getValue
Get the current value. -
getPrimitiveValue
Provides current value of the field as a Java primitive type.- Returns:
- current value
-
toString
public java.lang.String toString()Provides current value as a String.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String version of the provided value
- See Also:
- X3D Tooltips: type SFNode
-
setValue
Assign a new value to this field.- Specified by:
setValue
in interfaceSFNode
- Parameters:
newValue
- The replacement value to assign.- See Also:
X3DConcreteField.getTupleSize(String)
-
setValue
Apply an SFNodeObject value to this field.- Parameters:
newValue
- The newValue to apply- Returns:
SFNodeObject
- namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
-
clearChildren
Utility method to clear all contained children including nodes, statements and comments (if any).- Returns:
SFNodeObject
- namely this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
-
isDefaultValue
public boolean isDefaultValue()Determine whether current value matches DEFAULT_VALUE- Returns:
- whether current value matches DEFAULT_VALUE
- See Also:
DEFAULT_VALUE
-