Class SoSFString

  • Direct Known Subclasses:
    SoSFFilePathString

    public class SoSFString
    extends SoSField
    Field containing a string. A field containing an string (sequence of characters).

    SoSFStrings are written to file as a sequence of ASCII characters in double quotes (optional if the string doesn't contain any whitespace). Any characters (including newlines) may appear within the quotes. To include a double quote character within the string, precede it with a backslash. For example:

       Testing
       "One, Two, Three"
       "He said, \"Immel did it!\""
    are all valid strings.

    Unicode Support

    Unicode is an industry standard for encoding text of all forms and languages for use by computers. Open Inventor supports Unicode encoding, which allows internationalization of text in a standard cross-platform fashion.

    To be able to display a particular Unicode character, the selected font must have a character for that Unicode value. Many fonts do not contain a complete set of Unicode characters. However, the shareware Unicode font file "Code2000" seems to work well.

    Note that Unicode characters are not directly supported in Open Inventor files. Unicode strings are written as if the bytes in the string were a string of 8-bit characters. The string will be prefixed by "MCS_U_".

    See Also:
    SoField, SoSField, SoMFString
    • Constructor Detail

      • SoSFString

        public SoSFString​(SoFieldContainer fieldContainer,
                          java.lang.String fieldName,
                          SoField.FieldTypes fieldType,
                          java.lang.String defaultValue)
        Default constructor.
    • Method Detail

      • setValue

        public void setValue​(java.lang.String newValue)
        Sets this field to newValue.
      • getValue

        public java.lang.String getValue()
        Returns this field's value.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class SoField