Class SFInt32Object

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_VALUE
      Default value for this field type is 0.
      static java.lang.String DEFAULT_VALUE_STRING
      Default string value for this field type is "0".
      static java.lang.String NAME
      String constant NAME provides name of this element: SFInt32
      static java.util.regex.Pattern PATTERN
      Precompiled regular expression (regex) pattern for this field type using default REGEX value.
      static java.lang.String REGEX
      Default regular expression (regex) pattern for this field type is (\s)*[+-]?
      static 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
      SFInt32Object()
      Constructor for SFInt32Object performs value initialization.
      SFInt32Object​(int newValue)
      Constructor for SFInt32Object using a corresponding Java primitive int as new initial value.
      SFInt32Object​(SFInt32Object newValue)
      Constructor to copy an SFInt32Object value as initial value for this new field object.
    • Constructor Detail

      • SFInt32Object

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

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

        public SFInt32Object​(int newValue)
        Constructor for SFInt32Object using a corresponding Java primitive int as new initial value.
        Parameters:
        newValue - is new value to assign setContainerFieldOverride(containerFieldName); // apply checksConcreteField#getTupleSize(String)
    • Method Detail

      • equals

        public boolean equals​(SFInt32Object comparisonSFInt32Object)
        Determine whether two objects contain equal values.
        Parameters:
        comparisonSFInt32Object - field type to compare
        Returns:
        true if equivalent, false otherwise
      • validate

        public final java.lang.String validate()
        Validate current value via get/set comparison tests
        Returns:
        empty string if get/set testing passes, warning otherwise
        See Also:
        validate(), validateRegex()
      • matches

        public static final boolean matches​(java.lang.String value)
        Test PATTERN match with regular expression (regex) of provided value.
        Parameters:
        value - String to check against regex pattern for successful match
        Returns:
        true if PATTERN matches, false otherwise
        See Also:
        REGEX, PATTERN, matches(), matches(String), validate(), java.util.regex.Pattern
      • setValueByString

        public SFInt32Object setValueByString​(java.lang.String newValue)
                                       throws InvalidFieldValueException
        Utility accessor for SFInt32Object using String value (which must pass parsing validation checks).

        Warning: this method is not type safe at compile time! Best practice for X3DJSAIL programmers is to use strongly typed methods instead, in order to avoid potential for run-time errors.
        Parameters:
        newValue - is new value to assign, if empty then assign DEFAULT_VALUE
        Returns:
        MFMatrix4dObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same node object).
        Throws:
        InvalidFieldValueException
        See Also:
        X3DLoaderDOM.toX3dObjectTree(org.w3c.dom.Node)
      • toString

        public static java.lang.String toString​(int 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 int getValue()
        Get the current value.
        Specified by:
        getValue in interface SFInt32
        Returns:
        current value
      • getPrimitiveValue

        public int 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 SFInt32
      • toStringHexadecimal

        public java.lang.String toStringHexadecimal()
        Provide value in hexadecimal format.
        Returns:
        String version of the provided value
        See Also:
        X3D Tooltips: type SFInt32
      • setValue

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

        public boolean isDefaultValue()
        Determine whether current value matches DEFAULT_VALUE
        Returns:
        whether current value matches DEFAULT_VALUE
        See Also:
        DEFAULT_VALUE