Interface ISFSArray

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void add​(SFSDataWrapper wrappedObject)  
      void addBool​(boolean value)
      Add a boolean
      void addBoolArray​(java.util.Collection<java.lang.Boolean> value)
      Add an collection of boolean
      void addByte​(byte value)
      Add a byte (signed 8-bit)
      void addByteArray​(byte[] value)
      Add an array of bytes
      void addClass​(java.lang.Object o)
      Add a Class instance.
      void addDouble​(double value)
      Add a byte (signed decimal 64-bit)
      void addDoubleArray​(java.util.Collection<java.lang.Double> value)
      Add a collection of double
      void addFloat​(float value)
      Add a byte (signed decimal 32-bit)
      void addFloatArray​(java.util.Collection<java.lang.Float> value)
      Add a collection of float
      void addInt​(int value)
      Add a byte (signed 32-bit)
      void addIntArray​(java.util.Collection<java.lang.Integer> value)
      Add a collection of int
      void addLong​(long value)
      Add a byte (signed 64-bit)
      void addLongArray​(java.util.Collection<java.lang.Long> value)
      Add a collection of long
      void addNull()
      Add a null field to the Object.
      void addSFSArray​(ISFSArray value)
      Add a nested ISFSArray
      void addSFSObject​(ISFSObject value)
      Add a nested ISFSObject
      void addShort​(short value)
      Add a byte (signed 16-bit)
      void addShortArray​(java.util.Collection<java.lang.Short> value)
      Add a collection of short
      void addText​(java.lang.String value)
      Add a long String encoded in UTF-8 with max length of 2 GBytes
      void addUtfString​(java.lang.String value)
      Add a String encoded in UTF-8 with max length of 32 KBytes
      void addUtfStringArray​(java.util.Collection<java.lang.String> value)
      Add a collection of string
      boolean contains​(java.lang.Object obj)
      Checks if a specific element is contained in the array
      SFSDataWrapper get​(int index)  
      java.lang.Boolean getBool​(int index)
      Get the element at the specified index as Boolean.
      java.util.Collection<java.lang.Boolean> getBoolArray​(int index)
      Get the element at the specified index as Collection of Boolean.
      java.lang.Byte getByte​(int index)
      Get the element at the specified index as Byte.
      byte[] getByteArray​(int index)
      Get the element at the specified index as byte array.
      java.lang.Object getClass​(int index)
      Get the element at the specified index as Class instance.
      java.lang.Double getDouble​(int index)
      Get the element at the specified index as Double.
      java.util.Collection<java.lang.Double> getDoubleArray​(int index)
      Get the element at the specified index as Collection of Double.
      java.lang.String getDump()
      Get a detailed dump of the SFSArray structure
      java.lang.String getDump​(boolean noFormat)
      Get a detailed dump of the SFSArray structure
      java.lang.Object getElementAt​(int index)  
      java.lang.Float getFloat​(int index)
      Get the element at the specified index as Float.
      java.util.Collection<java.lang.Float> getFloatArray​(int index)
      Get the element at the specified index as Collection of Float.
      java.lang.String getHexDump()
      Get a pretty-printed hex-dump of the array
      java.lang.Integer getInt​(int index)
      Get the element at the specified index as Integer.
      java.util.Collection<java.lang.Integer> getIntArray​(int index)
      Get the element at the specified index as Collection of Int.
      java.lang.Long getLong​(int index)
      Get the element at the specified index as Long.
      java.util.Collection<java.lang.Long> getLongArray​(int index)
      Get the element at the specified index as Collection of Long.
      ISFSArray getSFSArray​(int index)
      Get the element at the specified index as ISFSArray.
      ISFSObject getSFSObject​(int index)
      Get the element at the specified index as ISFSObject.
      java.lang.Short getShort​(int index)
      Get the element at the specified index as Short.
      java.util.Collection<java.lang.Short> getShortArray​(int index)
      Get the element at the specified index as Collection of Short.
      java.lang.String getText​(int index)
      Get the element at the specified index as long String, with a max length of 2 GBytes.
      java.lang.Integer getUnsignedByte​(int index)
      Get the element at the specified index as an unsigned Integer (bytes are always signed, -127 < b < 127)
      It can be null if no element exists for the specified index
      java.util.Collection<java.lang.Integer> getUnsignedByteArray​(int index)
      Get the element at the specified index as a Collection of unsigned integers.
      java.lang.String getUtfString​(int index)
      Get the element at the specified index as String, with a max length of 32 KBytes.
      java.util.Collection<java.lang.String> getUtfStringArray​(int index)
      Get the element at the specified index as Collection of String.
      boolean isNull​(int index)
      Checks if a specific element is null.
      java.util.Iterator<SFSDataWrapper> iterator()  
      void removeElementAt​(int index)
      Remove an element at a specific index
      int size()
      Return the number of elements contained in the array
      byte[] toBinary()
      Return the binary representation of the SFSArray
      java.lang.String toJson()
      Return the JSON representation of the SFSArray
    • Method Detail

      • contains

        boolean contains​(java.lang.Object obj)
        Checks if a specific element is contained in the array
        Parameters:
        obj - the object
        Returns:
        true if the object exists
      • getElementAt

        java.lang.Object getElementAt​(int index)
      • removeElementAt

        void removeElementAt​(int index)
        Remove an element at a specific index
        Parameters:
        index - the index of the element to remove
      • size

        int size()
        Return the number of elements contained in the array
        Returns:
        the number of elements contained in the array
      • toBinary

        byte[] toBinary()
        Return the binary representation of the SFSArray
        Returns:
        the binary representation of the SFSArray
      • toJson

        java.lang.String toJson()
        Return the JSON representation of the SFSArray
        Returns:
        the JSON representation of the SFSArray
      • getHexDump

        java.lang.String getHexDump()
        Get a pretty-printed hex-dump of the array
        Returns:
        a pretty-printed hex-dump of the array
      • getDump

        java.lang.String getDump()
        Get a detailed dump of the SFSArray structure
        Returns:
        a detailed dump of the SFSArray structure
      • getDump

        java.lang.String getDump​(boolean noFormat)
        Get a detailed dump of the SFSArray structure
        Parameters:
        noFormat - if true the dump will not be pretty-printed
        Returns:
        a detailed dump of the SFSArray structure
      • addNull

        void addNull()
        Add a null field to the Object. Normally we recommend that null values are simply not sent. On the other end of the application you can simply check if a specific key exists or not, to detect a null.

        This method will effectively add the key and a byte id to describe the Null value, thus "bloating" the message

      • addBool

        void addBool​(boolean value)
        Add a boolean
        Parameters:
        value -
      • addByte

        void addByte​(byte value)
        Add a byte (signed 8-bit)
        Parameters:
        value -
      • addShort

        void addShort​(short value)
        Add a byte (signed 16-bit)
        Parameters:
        value -
      • addInt

        void addInt​(int value)
        Add a byte (signed 32-bit)
        Parameters:
        value -
      • addLong

        void addLong​(long value)
        Add a byte (signed 64-bit)
        Parameters:
        value -
      • addFloat

        void addFloat​(float value)
        Add a byte (signed decimal 32-bit)
        Parameters:
        value -
      • addDouble

        void addDouble​(double value)
        Add a byte (signed decimal 64-bit)
        Parameters:
        value -
      • addUtfString

        void addUtfString​(java.lang.String value)
        Add a String encoded in UTF-8 with max length of 32 KBytes
        Parameters:
        value -
      • addText

        void addText​(java.lang.String value)
        Add a long String encoded in UTF-8 with max length of 2 GBytes
        Parameters:
        value -
      • addBoolArray

        void addBoolArray​(java.util.Collection<java.lang.Boolean> value)
        Add an collection of boolean
        Parameters:
        value -
      • addByteArray

        void addByteArray​(byte[] value)
        Add an array of bytes

        NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.

        Parameters:
        value -
      • addShortArray

        void addShortArray​(java.util.Collection<java.lang.Short> value)
        Add a collection of short
        Parameters:
        value -
      • addIntArray

        void addIntArray​(java.util.Collection<java.lang.Integer> value)
        Add a collection of int
        Parameters:
        value -
      • addLongArray

        void addLongArray​(java.util.Collection<java.lang.Long> value)
        Add a collection of long
        Parameters:
        value -
      • addFloatArray

        void addFloatArray​(java.util.Collection<java.lang.Float> value)
        Add a collection of float
        Parameters:
        value -
      • addDoubleArray

        void addDoubleArray​(java.util.Collection<java.lang.Double> value)
        Add a collection of double
        Parameters:
        value -
      • addUtfStringArray

        void addUtfStringArray​(java.util.Collection<java.lang.String> value)
        Add a collection of string
        Parameters:
        value -
      • addSFSArray

        void addSFSArray​(ISFSArray value)
        Add a nested ISFSArray
        Parameters:
        value -
      • addSFSObject

        void addSFSObject​(ISFSObject value)
        Add a nested ISFSObject
        Parameters:
        value -
      • addClass

        void addClass​(java.lang.Object o)
        Add a Class instance. The instance must implement the SerializableSFSType interface.

        NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.

        Parameters:
        o - the instance
        See Also:
        SFSObject.newFromObject(Object)
      • isNull

        boolean isNull​(int index)
        Checks if a specific element is null.
        Parameters:
        index - the index of the element in the array
        Returns:
        true if the item is null
      • getBool

        java.lang.Boolean getBool​(int index)
        Get the element at the specified index as Boolean. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getByte

        java.lang.Byte getByte​(int index)
        Get the element at the specified index as Byte. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getUnsignedByte

        java.lang.Integer getUnsignedByte​(int index)
        Get the element at the specified index as an unsigned Integer (bytes are always signed, -127 < b < 127)
        It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getShort

        java.lang.Short getShort​(int index)
        Get the element at the specified index as Short. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getInt

        java.lang.Integer getInt​(int index)
        Get the element at the specified index as Integer. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getLong

        java.lang.Long getLong​(int index)
        Get the element at the specified index as Long. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getFloat

        java.lang.Float getFloat​(int index)
        Get the element at the specified index as Float. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getDouble

        java.lang.Double getDouble​(int index)
        Get the element at the specified index as Double. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getUtfString

        java.lang.String getUtfString​(int index)
        Get the element at the specified index as String, with a max length of 32 KBytes. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getText

        java.lang.String getText​(int index)
        Get the element at the specified index as long String, with a max length of 2 GBytes. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getBoolArray

        java.util.Collection<java.lang.Boolean> getBoolArray​(int index)
        Get the element at the specified index as Collection of Boolean. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getByteArray

        byte[] getByteArray​(int index)
        Get the element at the specified index as byte array. It can be null if no element exists for the specified index

        NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.

        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getUnsignedByteArray

        java.util.Collection<java.lang.Integer> getUnsignedByteArray​(int index)
        Get the element at the specified index as a Collection of unsigned integers. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getShortArray

        java.util.Collection<java.lang.Short> getShortArray​(int index)
        Get the element at the specified index as Collection of Short. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getIntArray

        java.util.Collection<java.lang.Integer> getIntArray​(int index)
        Get the element at the specified index as Collection of Int. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getLongArray

        java.util.Collection<java.lang.Long> getLongArray​(int index)
        Get the element at the specified index as Collection of Long. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getFloatArray

        java.util.Collection<java.lang.Float> getFloatArray​(int index)
        Get the element at the specified index as Collection of Float. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getDoubleArray

        java.util.Collection<java.lang.Double> getDoubleArray​(int index)
        Get the element at the specified index as Collection of Double. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getUtfStringArray

        java.util.Collection<java.lang.String> getUtfStringArray​(int index)
        Get the element at the specified index as Collection of String. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getClass

        java.lang.Object getClass​(int index)
        Get the element at the specified index as Class instance. The class definition is contained in the instance itself and it will be rebuilt using reflection. It can be null if no element exists for the specified index

        NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.

        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
        See Also:
        SFSObject.newFromObject(Object)
      • getSFSArray

        ISFSArray getSFSArray​(int index)
        Get the element at the specified index as ISFSArray. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      • getSFSObject

        ISFSObject getSFSObject​(int index)
        Get the element at the specified index as ISFSObject. It can be null if no element exists for the specified index
        Parameters:
        index -
        Returns:
        the element, or null
        Throws:
        java.lang.IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
        See Also:
        ISFSObject