Class ValueArray
- All Implemented Interfaces:
Closeable, AutoCloseable
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.
- Author:
- Sparsity Technologies http://www.sparsity-technologies.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the ValueArray instance.voidGet a Value from the array.boolean[]Get all the Values from this boolean arrayboolean[]getBoolean(int index, int size) Get a subset of the Values from this boolean arraydouble[]Get all the Values from this double arraydouble[]getDouble(int index, int size) Get a subset of the Values from this double arrayint[]Get all the Values from this int arrayint[]getInteger(int index, int size) Get a subset of the Values from this int arraylong[]getLong()Get all the Values from this long arraylong[]getLong(int index, int size) Get a subset of the Values from this long arraylong[]getOID()Get all the Values from this OID arraylong[]getOID(int index, int size) Get a subset of the Values from this long arraylong[]Get all the Values from this timestamp arraylong[]getTimestamp(int index, int size) Get a subset of the Values from this timestamp arraybooleanisClosed()Gets if ValueArray instance has been closed or not.voidmakeNull()Sets the attribute array to Null.voidSet a Value to a specific array position.voidSet a Value to the whole array.voidsetBoolean(boolean[] values) Set all the values of this bool array.voidsetBoolean(int index, boolean[] values) Set a subset of the values of this bool array.voidsetDouble(double[] values) Set all the values of this double array.voidsetDouble(int index, double[] values) Set a subset of the values of this double array.voidsetInteger(int[] values) Set all the values of this int array.voidsetInteger(int index, int[] values) Set a subset of the values of this int array.voidsetLong(int index, long[] values) Set a subset of the values of this long array.voidsetLong(long[] values) Set all the values of this long array.voidsetOID(int index, long[] values) Set a subset of the values of this oid array.voidsetOID(long[] values) Set all the values of this oid array.voidsetTimestamp(int index, long[] values) Set a subset of the values of this timestamp array.voidsetTimestamp(long[] values) Set all the values of this timestamp array.intsize()Returns the array size.
-
Method Details
-
getInteger
public int[] getInteger(int index, int size) Get a subset of the Values from this int array- Parameters:
index- Position of the first element to get [0..N-1]size- Number of elements to get [1..N]- Returns:
- Returns all the requested values
-
getTimestamp
public long[] getTimestamp(int index, int size) Get a subset of the Values from this timestamp array- Parameters:
index- Position of the first element to get [0..N-1]size- Number of elements to get [1..N]- Returns:
- Returns all the requested values
-
set
Set a Value to a specific array position.AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the element to set [0..N-1]value- [in] Value to set in the array element- Throws:
RuntimeException- If the index is out of range or the Value not validRuntimeException- null
-
setBoolean
public void setBoolean(int index, boolean[] values) throws RuntimeException, RuntimeException, RuntimeException Set a subset of the values of this bool array.UnsupportedOperationErrorIf array DataType is not bool AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the first element to set [0..N-1]values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If the index or size is out of rangeRuntimeException- null
-
setTimestamp
Set all the values of this timestamp array.AppErrorIf the ValueArray is not available
- Parameters:
values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If array DataType is not timestamp
-
setOID
Set all the values of this oid array.AppErrorIf the ValueArray is not available
- Parameters:
values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If array DataType is not oid
-
get
Get a Value from the array.AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the element to get [0..N-1]value- [out] Value to get the array element- Throws:
RuntimeException- If the index is out of range or the Value not validRuntimeException- null
-
setTimestamp
public void setTimestamp(int index, long[] values) throws RuntimeException, RuntimeException, RuntimeException Set a subset of the values of this timestamp array.UnsupportedOperationErrorIf array DataType is not timestamp AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the first element to set [0..N-1]values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If the index or size is out of rangeRuntimeException- null
-
getOID
public long[] getOID()Get all the Values from this OID array- Returns:
- Returns all the values
-
setInteger
public void setInteger(int index, int[] values) throws RuntimeException, RuntimeException, RuntimeException Set a subset of the values of this int array.UnsupportedOperationErrorIf array DataType is not int AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the first element to set [0..N-1]values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If the index or size is out of rangeRuntimeException- null
-
getLong
public long[] getLong(int index, int size) Get a subset of the Values from this long array- Parameters:
index- Position of the first element to get [0..N-1]size- Number of elements to get [1..N]- Returns:
- Returns all the requested values
-
getBoolean
public boolean[] getBoolean(int index, int size) Get a subset of the Values from this boolean array- Parameters:
index- Position of the first element to get [0..N-1]size- Number of elements to get [1..N]- Returns:
- Returns all the requested values
-
close
public void close()Closes the ValueArray instance.It must be called to ensure the integrity of all data.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getTimestamp
public long[] getTimestamp()Get all the Values from this timestamp array- Returns:
- Returns all the values
-
getBoolean
public boolean[] getBoolean()Get all the Values from this boolean array- Returns:
- Returns all the values
-
setBoolean
Set all the values of this bool array.AppErrorIf the ValueArray is not available
- Parameters:
values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If array DataType is not bool
-
getInteger
public int[] getInteger()Get all the Values from this int array- Returns:
- Returns all the values
-
getDouble
public double[] getDouble(int index, int size) Get a subset of the Values from this double array- Parameters:
index- Position of the first element to get [0..N-1]size- Number of elements to get [1..N]- Returns:
- Returns all the requested values
-
size
public int size()Returns the array size.- Returns:
- The number of elements in the array.
-
setDouble
public void setDouble(int index, double[] values) throws RuntimeException, RuntimeException, RuntimeException Set a subset of the values of this double array.UnsupportedOperationErrorIf array DataType is not Double AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the first element to set [0..N-1]values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If the index or size is out of rangeRuntimeException- null
-
makeNull
Sets the attribute array to Null.The ValueArray can not be used after this call.
- Throws:
RuntimeException- null
-
getOID
public long[] getOID(int index, int size) Get a subset of the Values from this long array- Parameters:
index- Position of the first element to get [0..N-1]size- Number of elements to get [1..N]- Returns:
- Returns all the requested values
-
setLong
public void setLong(int index, long[] values) throws RuntimeException, RuntimeException, RuntimeException Set a subset of the values of this long array.UnsupportedOperationErrorIf array DataType is not long AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the first element to set [0..N-1]values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If the index or size is out of rangeRuntimeException- null
-
getDouble
public double[] getDouble()Get all the Values from this double array- Returns:
- Returns all the values
-
setOID
public void setOID(int index, long[] values) throws RuntimeException, RuntimeException, RuntimeException Set a subset of the values of this oid array.UnsupportedOperationErrorIf array DataType is not oid AppErrorIf the ValueArray is not available
- Parameters:
index- [in] Position of the first element to set [0..N-1]values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If the index or size is out of rangeRuntimeException- null
-
isClosed
public boolean isClosed()Gets if ValueArray instance has been closed or not.- Returns:
- TRUE if the ValueArray instance has been closed, FALSE otherwise.
- See Also:
-
setLong
Set all the values of this long array.AppErrorIf the ValueArray is not available
- Parameters:
values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If array DataType is not long
-
setDouble
Set all the values of this double array.AppErrorIf the ValueArray is not available
- Parameters:
values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If array DataType is not Double
-
setInteger
Set all the values of this int array.AppErrorIf the ValueArray is not available
- Parameters:
values- [in] All the values to set- Throws:
RuntimeException- nullRuntimeException- If array DataType is not int
-
set
Set a Value to the whole array.AppErrorIf the ValueArray is not available
- Parameters:
value- [in] Value to set in all the array elements- Throws:
RuntimeException- If the Value is not validRuntimeException- null
-
getLong
public long[] getLong()Get all the Values from this long array- Returns:
- Returns all the values
-