Android Client Reference
Class DatabaseArray
Namespace: com.playerio
Language: Java
Represents an BigDB array of values that can be accessed by index.
DatabaseArray is very similar to the DatabaseObject class since it has methods for getting, setting, checking and removing values. But unlike DatabaseObject, this class also has methods for adding and inserting values, and there is no Save method, since these cannot be saved to a BigDB table, they always have to be a property of an object.
If we for example have an object that can be visualized like this:
Then we would create it in BigDB like this:
However, just like DatabaseObject, DatabaseArray also supports nested property names, and we can refer to values in the array with their index number. Using this, we can make the example object in an easier way, like this:
Getting values works exactly like for DatabaseObject, and we can also use nested properties.
In addition to getting and setting values, we can also add values to the end of the array, insert values in the middle of it, or remove values in the middle of it. Note that the arrays are sparse, this means that removing a value doesn't shift the indexes of the following values, and we can set any value beyond the last value of the array.
Methods | |||
---|---|---|---|
public DatabaseArray |
Add the given int value to the array |
||
public DatabaseArray |
Add the given long value to the array |
||
public DatabaseArray |
Add the given boolean value to the array |
||
public DatabaseArray |
Add the given DatabaseArray value to the array |
||
public DatabaseArray |
Add the given DatabaseObject value to the array |
||
public DatabaseArray |
Add the given String value to the array |
||
public DatabaseArray |
Add the given float value to the array |
||
public DatabaseArray |
Add the given byte array value to the array |
||
public DatabaseArray |
Add the given Date value to the array |
||
public DatabaseArray |
Add the given double value to the array |
||
public DatabaseArray |
Add the given uint value to the array |
||
public void |
Removes all properties in this array |
||
public boolean |
Returns true if the given property exists on this object |
||
public boolean |
Returns true if a value exists at the given index. |
||
public |
Create a new DatabaseArray |
||
public DatabaseArray |
Get the DatabaseArray property at the given index |
||
public DatabaseArray |
Get the given DatabaseArray property |
||
public boolean |
Get the given boolean property |
||
public boolean |
Get the given boolean property, or the default if it doesn't exist. |
||
public boolean |
Get the boolean property at the given index. |
||
public boolean |
Get the boolean property at the given index, or the default if it doesn't exist. |
||
public byte[] |
Get the given byte array property, or the default if it doesn't exist. |
||
public byte[] |
Get the given byte array property |
||
public byte[] |
Get the byte array property at the given index. |
||
public byte[] |
Get the byte array property at the given index, or the default if it doesn't exist. |
||
public Date |
Get the given Date property |
||
public Date |
Get the given Date property, or the default if it doesn't exist. |
||
public Date |
Get the Date property at the given index, or the default if it doesn't exist. |
||
public Date |
Get the Date property at the given index. |
||
public double |
Get the double property at the given index. |
||
public double |
Get the given double property |
||
public double |
Get the given double property, or the default if it doesn't exist. |
||
public double |
Get the double property at the given index, or the default if it doesn't exist. |
||
public float |
Get the float property at the given index. |
||
public float |
Get the float property at the given index, or the default if it doesn't exist. |
||
public float |
Get the given float property, or the default if it doesn't exist. |
||
public float |
Get the given float property |
||
public int |
Get the given int property, or the default if it doesn't exist. |
||
public int |
Get the given int property |
||
public int |
Get the String property at the given index, or the default if it doesn't exist. |
||
public int |
Get the int property at the given index. |
||
public long |
Get the long property at the given index. |
||
public long |
Get the given long property |
||
public long |
Get the long property at the given index, or the default if it doesn't exist. |
||
public long |
Get the given long property, or the default if it doesn't exist. |
||
public DatabaseObject |
Get the DatabaseObject property at the given index |
||
public DatabaseObject |
Get the given DatabaseObject property |
||
public String |
Get the given String property |
||
public String |
Get the String property at the given index, or the default if it doesn't exist. |
||
public String |
Get the String property at the given index. |
||
public String |
Get the given String property, or the default if it doesn't exist. |
||
public int |
Get the given uint property, or the default if it doesn't exist. |
||
public int |
Get the given uint property |
||
public int |
Get the uint property at the given index, or the default if it doesn't exist. |
||
public int |
Get the uint property at the given index. |
||
public Object |
Get the given property as an object |
||
public Object |
Get the property at the given index as an Object. |
||
public ArrayList<Integer> |
Get the indexes of all properties on this object, sorted |
||
public DatabaseArray |
Insert the value at the given index to the given boolean |
||
public DatabaseArray |
Insert the value at the given index to the given float |
||
public DatabaseArray |
Insert the value at the given index to the given long |
||
public DatabaseArray |
Insert the value at the given index to the given string |
||
public DatabaseArray |
Insert the value at the given index to the given int |
||
public DatabaseArray |
Insert the value at the given index to the given double |
||
public DatabaseArray |
Insert the value at the given index to the given DatabaseArray |
||
public DatabaseArray |
Insert the value at the given index to the given DatabaseObject |
||
public DatabaseArray |
Insert the value at the given index to the given byte array |
||
public DatabaseArray |
Insert the value at the given index to the given Date |
||
public DatabaseArray |
Insert the value at the given index to the given uint |
||
public void |
Remove the value at the given index |
||
public DatabaseArray |
Removes the given property from this object |
||
public DatabaseArray |
Set the given property to the given long value |
||
public DatabaseArray |
Set the given property to the given boolean value |
||
public DatabaseArray |
Set the given property to the given int value |
||
public DatabaseArray |
Set the given property to the given string value |
||
public DatabaseArray |
Set the given property to the given Date value |
||
public DatabaseArray |
Set the given property to the given DatabaseObject value |
||
public DatabaseArray |
Set the given property to the given DatabaseArray value |
||
public DatabaseArray |
Set the given property to the given bye array value |
||
public DatabaseArray |
Set the given property to the given float value |
||
public DatabaseArray |
Set the given property to the given double value |
||
public DatabaseArray |
Set the value at the given index to the given byte array |
||
public DatabaseArray |
Set the value at the given index to the given double |
||
public DatabaseArray |
Set the value at the given index to the given float |
||
public DatabaseArray |
Set the value at the given index to the given DatabaseArray |
||
public DatabaseArray |
Set the value at the given index to the given DatabaseObject |
||
public DatabaseArray |
Set the value at the given index to the given Date |
||
public DatabaseArray |
Set the value at the given index to the given boolean |
||
public DatabaseArray |
Set the value at the given index to the given string |
||
public DatabaseArray |
Set the value at the given index to the given int |
||
public DatabaseArray |
Set the value at the given index to the given long |
||
public DatabaseArray |
Set the value at the given index to the given uint |
||
public DatabaseArray |
Set the given property to the given uint value |
||
public int |
Returns the number of values in this array. |
DatabaseArray.add
public DatabaseArray |
|
Add the given int value to the array
Arguments
int | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given long value to the array
Arguments
long | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given boolean value to the array
Arguments
boolean | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given DatabaseArray value to the array
Arguments
DatabaseArray | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given DatabaseObject value to the array
Arguments
DatabaseObject | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given String value to the array
Arguments
String | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given float value to the array
Arguments
float | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given byte array value to the array
Arguments
byte[] | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given Date value to the array
Arguments
Date | value |
DatabaseArray.add
public DatabaseArray |
|
Add the given double value to the array
Arguments
double | value |
DatabaseArray.addUInt
public DatabaseArray |
|
Add the given uint value to the array
Arguments
int | value |
DatabaseArray.clear
public void |
|
Removes all properties in this array
DatabaseArray.contains
public boolean |
|
Returns true if the given property exists on this object
Arguments
String | propertyExpression |
DatabaseArray.contains
public boolean |
|
Returns true if a value exists at the given index.
Arguments
int | index |
DatabaseArray.DatabaseArray
public |
|
Create a new DatabaseArray
DatabaseArray.getArray
public DatabaseArray |
|
Get the DatabaseArray property at the given index
Arguments
int | index |
DatabaseArray.getArray
public DatabaseArray |
|
Get the given DatabaseArray property
Arguments
String | propertyExpression |
DatabaseArray.getBool
public boolean |
|
Get the given boolean property
Arguments
String | propertyExpression |
DatabaseArray.getBool
public boolean |
|
Get the given boolean property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
boolean | defaultValue |
DatabaseArray.getBool
public boolean |
|
Get the boolean property at the given index.
Arguments
int | index |
DatabaseArray.getBool
public boolean |
|
Get the boolean property at the given index, or the default if it doesn't exist.
Arguments
int | index |
boolean | defaultValue |
DatabaseArray.getBytes
public byte[] |
|
Get the given byte array property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
byte[] | defaultValue |
DatabaseArray.getBytes
public byte[] |
|
Get the given byte array property
Arguments
String | propertyExpression |
DatabaseArray.getBytes
public byte[] |
|
Get the byte array property at the given index.
Arguments
int | index |
DatabaseArray.getBytes
public byte[] |
|
Get the byte array property at the given index, or the default if it doesn't exist.
Arguments
int | index |
byte[] | defaultValue |
DatabaseArray.getDateTime
public Date |
|
Get the given Date property
Arguments
String | propertyExpression |
DatabaseArray.getDateTime
public Date |
|
Get the given Date property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
Date | defaultValue |
DatabaseArray.getDateTime
public Date |
|
Get the Date property at the given index, or the default if it doesn't exist.
Arguments
int | index |
Date | defaultValue |
DatabaseArray.getDateTime
public Date |
|
Get the Date property at the given index.
Arguments
int | index |
DatabaseArray.getDouble
public double |
|
Get the double property at the given index.
Arguments
int | index |
DatabaseArray.getDouble
public double |
|
Get the given double property
Arguments
String | propertyExpression |
DatabaseArray.getDouble
public double |
|
Get the given double property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
double | defaultValue |
DatabaseArray.getDouble
public double |
|
Get the double property at the given index, or the default if it doesn't exist.
Arguments
int | index |
double | defaultValue |
DatabaseArray.getFloat
public float |
|
Get the float property at the given index.
Arguments
int | index |
DatabaseArray.getFloat
public float |
|
Get the float property at the given index, or the default if it doesn't exist.
Arguments
int | index |
float | defaultValue |
DatabaseArray.getFloat
public float |
|
Get the given float property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
float | defaultValue |
DatabaseArray.getFloat
public float |
|
Get the given float property
Arguments
String | propertyExpression |
DatabaseArray.getInt
public int |
|
Get the given int property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
int | defaultValue |
DatabaseArray.getInt
public int |
|
Get the given int property
Arguments
String | propertyExpression |
DatabaseArray.getInt
public int |
|
Get the String property at the given index, or the default if it doesn't exist.
Arguments
int | index |
int | defaultValue |
DatabaseArray.getInt
public int |
|
Get the int property at the given index.
Arguments
int | index |
DatabaseArray.getLong
public long |
|
Get the long property at the given index.
Arguments
int | index |
DatabaseArray.getLong
public long |
|
Get the given long property
Arguments
String | propertyExpression |
DatabaseArray.getLong
public long |
|
Get the long property at the given index, or the default if it doesn't exist.
Arguments
int | index |
long | defaultValue |
DatabaseArray.getLong
public long |
|
Get the given long property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
long | defaultValue |
DatabaseArray.getObject
public DatabaseObject |
|
Get the DatabaseObject property at the given index
Arguments
int | index |
DatabaseArray.getObject
public DatabaseObject |
|
Get the given DatabaseObject property
Arguments
String | propertyExpression |
DatabaseArray.getString
public String |
|
Get the given String property
Arguments
String | propertyExpression |
DatabaseArray.getString
public String |
|
Get the String property at the given index, or the default if it doesn't exist.
Arguments
int | index |
String | defaultValue |
DatabaseArray.getString
public String |
|
Get the String property at the given index.
Arguments
int | index |
DatabaseArray.getString
public String |
|
Get the given String property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
String | defaultValue |
DatabaseArray.getUInt
public int |
|
Get the given uint property, or the default if it doesn't exist.
Arguments
String | propertyExpression |
int | defaultValue |
DatabaseArray.getUInt
public int |
|
Get the given uint property
Arguments
String | propertyExpression |
DatabaseArray.getUInt
public int |
|
Get the uint property at the given index, or the default if it doesn't exist.
Arguments
int | index |
int | defaultValue |
DatabaseArray.getUInt
public int |
|
Get the uint property at the given index.
Arguments
int | index |
DatabaseArray.getValue
public Object |
|
Get the given property as an object
Arguments
String | propertyExpression |
DatabaseArray.getValue
public Object |
|
Get the property at the given index as an Object.
Arguments
int | index |
DatabaseArray.indexes
public ArrayList<Integer> |
|
Get the indexes of all properties on this object, sorted
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given boolean
Arguments
int | index |
boolean | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given float
Arguments
int | index |
float | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given long
Arguments
int | index |
long | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given string
Arguments
int | index |
String | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given int
Arguments
int | index |
int | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given double
Arguments
int | index |
double | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given DatabaseArray
Arguments
int | index |
DatabaseArray | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given DatabaseObject
Arguments
int | index |
DatabaseObject | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given byte array
Arguments
int | index |
byte[] | value |
DatabaseArray.insert
public DatabaseArray |
|
Insert the value at the given index to the given Date
Arguments
int | index |
Date | value |
DatabaseArray.insertUInt
public DatabaseArray |
|
Insert the value at the given index to the given uint
Arguments
int | index |
int | value |
DatabaseArray.remove
public void |
|
Remove the value at the given index
Arguments
int | index |
DatabaseArray.remove
public DatabaseArray |
|
Removes the given property from this object
Arguments
String | propertyExpression |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given long value
Arguments
String | propertyExpression |
long | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given boolean value
Arguments
String | propertyExpression |
boolean | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given int value
Arguments
String | propertyExpression |
int | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given string value
Arguments
String | propertyExpression |
String | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given Date value
Arguments
String | propertyExpression |
Date | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given DatabaseObject value
Arguments
String | propertyExpression |
DatabaseObject | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given DatabaseArray value
Arguments
String | propertyExpression |
DatabaseArray | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given bye array value
Arguments
String | propertyExpression |
byte[] | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given float value
Arguments
String | propertyExpression |
float | value |
DatabaseArray.set
public DatabaseArray |
|
Set the given property to the given double value
Arguments
String | propertyExpression |
double | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given byte array
Arguments
int | index |
byte[] | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given double
Arguments
int | index |
double | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given float
Arguments
int | index |
float | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given DatabaseArray
Arguments
int | index |
DatabaseArray | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given DatabaseObject
Arguments
int | index |
DatabaseObject | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given Date
Arguments
int | index |
Date | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given boolean
Arguments
int | index |
boolean | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given string
Arguments
int | index |
String | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given int
Arguments
int | index |
int | value |
DatabaseArray.set
public DatabaseArray |
|
Set the value at the given index to the given long
Arguments
int | index |
long | value |
DatabaseArray.setUInt
public DatabaseArray |
|
Set the value at the given index to the given uint
Arguments
int | index |
int | value |
DatabaseArray.setUInt
public DatabaseArray |
|
Set the given property to the given uint value
Arguments
String | propertyExpression |
int | value |
DatabaseArray.size
public int |
|
Returns the number of values in this array.