Class SFNode

All Implemented Interfaces:
SFNode, X3DField

public class SFNode extends X3DConcreteField implements SFNode
This utility class provides a concrete implementation corresponding to SFNode X3D field type.

Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the org.web3d.x3d.jsail classes.
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: MFNode
See Also:
  • Field Details

    • NAME

      public static final String NAME
      String constant NAME provides name of this element: SFNode
      See Also:
    • DEFAULT_VALUE

      public static final X3DNode DEFAULT_VALUE
      Default value for this field type is a null node.
      See Also:
    • DEFAULT_VALUE_STRING

      public static final String DEFAULT_VALUE_STRING
      Default string value for this field type is "".
      See Also:
    • TUPLE_SIZE

      public static final 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).
      See Also:
  • Constructor Details

    • SFNode

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

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

      public SFNode(X3DNode newValue)
      Constructor for SFNode using a corresponding Java primitive org.web3d.x3d.sai.Core.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 SFNode applies default initial value.
      Specified by:
      initialize in class X3DConcreteField
      See Also:
    • toString

      public static 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:
    • 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 String toString()
      Provides current value as a String.
      Overrides:
      toString in class Object
      Returns:
      String version of the provided value
      See Also:
    • 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:
    • setValue

      public SFNode setValue(SFNode newValue)
      Apply an SFNode value to this field.
      Parameters:
      newValue - The newValue to apply
      Returns:
      SFNode - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
    • clearChildren

      public SFNode clearChildren()
      Utility method to clear all contained children including nodes, statements and comments (if any).
      Returns:
      SFNode - 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: