public class ValueArray
extends java.lang.Object
implements java.io.Closeable
It allows for getting and setting ValueArray attribute values.
It is very important to close the ValueArray once no more get or set operations will be performed.
Creation of a new ValueArray: (i) Set all the ValueArray elements using Graph::SetAttributeArray (ii) perform as many get/set operations as you need to the ValueArray instance. Lastly, (iii) Close the ValueArray
Use of an existing ValueArray: (i) Get a ValueArray instance using Graph::GetAttributeArray (ii) perform as many get/set operations as you need to the ValueArray instance. Lastly, (iii) Close the ValueArray
Check out the 'Attributes and values' section in the SPARKSEE User Manual for more details on this.
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the ValueArray instance.
|
void |
get(int index,
Value value)
Get a Value from the array.
|
boolean[] |
getBoolean()
Get all the Values from this boolean array
|
boolean[] |
getBoolean(int index,
int size)
Get a subset of the Values from this boolean array
|
double[] |
getDouble()
Get all the Values from this double array
|
double[] |
getDouble(int index,
int size)
Get a subset of the Values from this double array
|
int[] |
getInteger()
Get all the Values from this int array
|
int[] |
getInteger(int index,
int size)
Get a subset of the Values from this int array
|
long[] |
getLong()
Get all the Values from this long array
|
long[] |
getLong(int index,
int size)
Get a subset of the Values from this long array
|
long[] |
getOID()
Get all the Values from this OID array
|
long[] |
getOID(int index,
int size)
Get a subset of the Values from this long array
|
long[] |
getTimestamp()
Get all the Values from this timestamp array
|
long[] |
getTimestamp(int index,
int size)
Get a subset of the Values from this timestamp array
|
boolean |
isClosed()
Gets if ValueArray instance has been closed or not.
|
void |
makeNull()
Sets the attribute array to Null.
|
void |
set(int index,
Value value)
Set a Value to a specific array position.
|
void |
set(Value value)
Set a Value to the whole array.
|
void |
setBoolean(boolean[] values)
Set all the values of this bool array.
|
void |
setBoolean(int index,
boolean[] values)
Set a subset of the values of this bool array.
|
void |
setDouble(double[] values)
Set all the values of this double array.
|
void |
setDouble(int index,
double[] values)
Set a subset of the values of this double array.
|
void |
setInteger(int[] values)
Set all the values of this int array.
|
void |
setInteger(int index,
int[] values)
Set a subset of the values of this int array.
|
void |
setLong(int index,
long[] values)
Set a subset of the values of this long array.
|
void |
setLong(long[] values)
Set all the values of this long array.
|
void |
setOID(int index,
long[] values)
Set a subset of the values of this oid array.
|
void |
setOID(long[] values)
Set all the values of this oid array.
|
void |
setTimestamp(int index,
long[] values)
Set a subset of the values of this timestamp array.
|
void |
setTimestamp(long[] values)
Set all the values of this timestamp array.
|
int |
size()
Returns the array size.
|
public int[] getInteger(int index, int size)
index
- Position of the first element to get [0..N-1]size
- Number of elements to get [1..N]public long[] getTimestamp(int index, int size)
index
- Position of the first element to get [0..N-1]size
- Number of elements to get [1..N]public void set(int index, Value value) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
index
- [in] Position of the element to set [0..N-1]value
- [in] Value to set in the array elementjava.lang.RuntimeException
- If the index is out of range or the Value not validjava.lang.RuntimeException
- nullpublic void setBoolean(int index, boolean[] values) throws java.lang.RuntimeException, java.lang.RuntimeException, java.lang.RuntimeException
UnsupportedOperationErrorIf array DataType is not bool AppErrorIf the ValueArray is not available
index
- [in] Position of the first element to set [0..N-1]values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If the index or size is out of rangejava.lang.RuntimeException
- nullpublic void setTimestamp(long[] values) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If array DataType is not timestamppublic void setOID(long[] values) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If array DataType is not oidpublic void get(int index, Value value) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
index
- [in] Position of the element to get [0..N-1]value
- [out] Value to get the array elementjava.lang.RuntimeException
- If the index is out of range or the Value not validjava.lang.RuntimeException
- nullpublic void setTimestamp(int index, long[] values) throws java.lang.RuntimeException, java.lang.RuntimeException, java.lang.RuntimeException
UnsupportedOperationErrorIf array DataType is not timestamp AppErrorIf the ValueArray is not available
index
- [in] Position of the first element to set [0..N-1]values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If the index or size is out of rangejava.lang.RuntimeException
- nullpublic long[] getOID()
public void setInteger(int index, int[] values) throws java.lang.RuntimeException, java.lang.RuntimeException, java.lang.RuntimeException
UnsupportedOperationErrorIf array DataType is not int AppErrorIf the ValueArray is not available
index
- [in] Position of the first element to set [0..N-1]values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If the index or size is out of rangejava.lang.RuntimeException
- nullpublic long[] getLong(int index, int size)
index
- Position of the first element to get [0..N-1]size
- Number of elements to get [1..N]public boolean[] getBoolean(int index, int size)
index
- Position of the first element to get [0..N-1]size
- Number of elements to get [1..N]public void close()
It must be called to ensure the integrity of all data.
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public long[] getTimestamp()
public boolean[] getBoolean()
public void setBoolean(boolean[] values) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If array DataType is not boolpublic int[] getInteger()
public double[] getDouble(int index, int size)
index
- Position of the first element to get [0..N-1]size
- Number of elements to get [1..N]public int size()
public void setDouble(int index, double[] values) throws java.lang.RuntimeException, java.lang.RuntimeException, java.lang.RuntimeException
UnsupportedOperationErrorIf array DataType is not Double AppErrorIf the ValueArray is not available
index
- [in] Position of the first element to set [0..N-1]values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If the index or size is out of rangejava.lang.RuntimeException
- nullpublic void makeNull() throws java.lang.RuntimeException
The ValueArray can not be used after this call.
java.lang.RuntimeException
- nullpublic long[] getOID(int index, int size)
index
- Position of the first element to get [0..N-1]size
- Number of elements to get [1..N]public void setLong(int index, long[] values) throws java.lang.RuntimeException, java.lang.RuntimeException, java.lang.RuntimeException
UnsupportedOperationErrorIf array DataType is not long AppErrorIf the ValueArray is not available
index
- [in] Position of the first element to set [0..N-1]values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If the index or size is out of rangejava.lang.RuntimeException
- nullpublic double[] getDouble()
public void setOID(int index, long[] values) throws java.lang.RuntimeException, java.lang.RuntimeException, java.lang.RuntimeException
UnsupportedOperationErrorIf array DataType is not oid AppErrorIf the ValueArray is not available
index
- [in] Position of the first element to set [0..N-1]values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If the index or size is out of rangejava.lang.RuntimeException
- nullpublic boolean isClosed()
close()
public void setLong(long[] values) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If array DataType is not longpublic void setDouble(double[] values) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If array DataType is not Doublepublic void setInteger(int[] values) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
values
- [in] All the values to setjava.lang.RuntimeException
- nulljava.lang.RuntimeException
- If array DataType is not intpublic void set(Value value) throws java.lang.RuntimeException, java.lang.RuntimeException
AppErrorIf the ValueArray is not available
value
- [in] Value to set in all the array elementsjava.lang.RuntimeException
- If the Value is not validjava.lang.RuntimeException
- nullpublic long[] getLong()