Class SFNodeObject

java.lang.Object
org.web3d.x3d.jsail.fields.X3DConcreteField
org.web3d.x3d.jsail.fields.SFNodeObject
All Implemented Interfaces:
SFNode, X3DField

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: MFNodeObject
See Also:
X3D Tooltips: type SFNode, SAI Java Specification: B.4.11 X3DFieldTypes, SAI Abstract Specification: 5.2.15 SAIFieldType, X3D Abstract Specification: SFNodeAndMFNode, X3D Tooltips, X3D Tooltips: field, X3D Tooltips: fieldValue, X3D Scene Authoring Hints
  • Field Details

  • Constructor Details

    • SFNodeObject

      public SFNodeObject()
      Constructor for SFNodeObject performs value initialization.
    • SFNodeObject

      public SFNodeObject​(SFNodeObject newValue)
      Constructor to copy an SFNodeObject value as initial value for this new field object.
      Parameters:
      newValue - The newValue to apply
    • SFNodeObject

      public SFNodeObject​(X3DNode newValue)
      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 class X3DConcreteField
      See Also:
      DEFAULT_VALUE
    • toString

      public static java.lang.String toString​(X3DNode value)
      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

      public X3DNode getValue()
      Get the current value.
      Specified by:
      getValue in interface SFNode
      Returns:
      current value
    • getPrimitiveValue

      public X3DNode 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 class java.lang.Object
      Returns:
      String version of the provided value
      See Also:
      X3D Tooltips: type SFNode
    • setValue

      public void setValue​(X3DNode newValue)
      Assign a new value to this field.
      Specified by:
      setValue in interface SFNode
      Parameters:
      newValue - The replacement value to assign.
      See Also:
      X3DConcreteField.getTupleSize(String)
    • setValue

      public SFNodeObject setValue​(SFNodeObject newValue)
      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

      public SFNodeObject 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