Interface ISFSArray

All Known Implementing Classes:
SFSArray, SFSArrayLite

public interface ISFSArray
  • Method Details

    • contains

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

    • getElementAt

      Object getElementAt(int index)
    • get

      SFSDataWrapper get(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

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

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

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

      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 -
    • addString

      void addString(String value)
      Add a UTF encoded string with max length of 32768 bytes
      Parameters:
      value -
    • addShortString

      void addShortString(String value)
      Add a UTF encoded string with max length of 255 bytes
      Parameters:
      value -
    • addText

      void addText(String value)
      Add a UTF encoded long String with max length of 2 GBytes
      Parameters:
      value -
    • addVector2

      void addVector2(SFSVector2 value)
      Add a SFSVector2 (2x float 32bit)
      Parameters:
      value -
    • addVector3

      void addVector3(SFSVector3 value)
      Add a SFSVector3 (3x float 32bit)
      Parameters:
      value -
    • addBoolArray

      void addBoolArray(Collection<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(Collection<Short> value)
      Add a collection of short
      Parameters:
      value -
    • addIntArray

      void addIntArray(Collection<Integer> value)
      Add a collection of int
      Parameters:
      value -
    • addLongArray

      void addLongArray(Collection<Long> value)
      Add a collection of long
      Parameters:
      value -
    • addFloatArray

      void addFloatArray(Collection<Float> value)
      Add a collection of float
      Parameters:
      value -
    • addDoubleArray

      void addDoubleArray(Collection<Double> value)
      Add a collection of double
      Parameters:
      value -
    • addStringArray

      void addStringArray(Collection<String> value)
      Add a collection of UTF encoded strings, each string limited to a max of 32768 bytes The collection is also limited to a max of 32768 elements
      Parameters:
      value -
    • addShortStringArray

      void addShortStringArray(Collection<String> value)
      Add a collection of UTF encoded strings, each string limited to a max of 255 bytes The collection is also limited to a max of 32768 elements
      Parameters:
      value -
    • addVector2Array

      void addVector2Array(Collection<SFSVector2> value)
      Add a collection of SFSVector2
      Parameters:
      value -
    • addVector3Array

      void addVector3Array(Collection<SFSVector3> value)
      Add a collection of SFSVector3
      Parameters:
      value -
    • addSFSArray

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

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

      void add(SFSDataWrapper wrappedObject)
    • 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

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getByte

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getUnsignedByte

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getShort

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getInt

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getLong

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getFloat

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getDouble

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getString

      String getString(int index)
      Get the element at the specified index as string, with a max length of 32768 bytes It can be null if no element exists for the specified index
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getShortString

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

      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getVector2

      SFSVector2 getVector2(int index)
      Get the element at the specified index as SFSVector2.
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getVector3

      SFSVector3 getVector3(int index)
      Get the element at the specified index as SFSVector3.
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getBoolArray

      Collection<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:
      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getUnsignedByteArray

      Collection<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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getShortArray

      Collection<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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getIntArray

      Collection<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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getLongArray

      Collection<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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getFloatArray

      Collection<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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getDoubleArray

      Collection<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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getStringArray

      Collection<String> getStringArray(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 Each string is limited to 32768 bytes
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getShortStringArray

      Collection<String> getShortStringArray(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 Each string is limited to 255 bytes
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getVector2Array

      Collection<SFSVector2> getVector2Array(int index)
      Get the element at the specified index as Collection of SFSVector2. It can be null if no element exists for the specified index
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • getVector3Array

      Collection<SFSVector3> getVector3Array(int index)
      Get the element at the specified index as Collection of SFSVector3. It can be null if no element exists for the specified index Each string is limited to 255 bytes
      Parameters:
      index -
      Returns:
      the element, or null
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
    • 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:
      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:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size()).
      See Also: