Package edu.wpi.first.networktables
Class NetworkTableValue
- java.lang.Object
-
- edu.wpi.first.networktables.NetworkTableValue
-
public final class NetworkTableValue extends Object
A network table entry value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)booleangetBoolean()Get the entry's boolean value.boolean[]getBooleanArray()Get the entry's boolean array value.doublegetDouble()Get the entry's double value.double[]getDoubleArray()Get the entry's double array value.byte[]getRaw()Get the entry's raw value.byte[]getRpc()Get the entry's rpc definition value.StringgetString()Get the entry's string value.String[]getStringArray()Get the entry's string array value.longgetTime()Get the creation time of the value.NetworkTableTypegetType()Get the data type.ObjectgetValue()Get the data value stored.inthashCode()booleanisBoolean()Determine if entry value contains a boolean.booleanisBooleanArray()Determine if entry value contains a boolean array.booleanisDouble()Determine if entry value contains a double.booleanisDoubleArray()Determine if entry value contains a double array.booleanisRaw()Determine if entry value contains a raw.booleanisRpc()Determine if entry value contains a rpc definition.booleanisString()Determine if entry value contains a string.booleanisStringArray()Determine if entry value contains a string array.booleanisValid()Determine if entry value contains a value or is unassigned.static NetworkTableValuemakeBoolean(boolean value)Creates a boolean entry value.static NetworkTableValuemakeBoolean(boolean value, long time)Creates a boolean entry value.static NetworkTableValuemakeBooleanArray(boolean[] value)Creates a boolean array entry value.static NetworkTableValuemakeBooleanArray(boolean[] value, long time)Creates a boolean array entry value.static NetworkTableValuemakeBooleanArray(Boolean[] value)Creates a boolean array entry value.static NetworkTableValuemakeBooleanArray(Boolean[] value, long time)Creates a boolean array entry value.static NetworkTableValuemakeDouble(double value)Creates a double entry value.static NetworkTableValuemakeDouble(double value, long time)Creates a double entry value.static NetworkTableValuemakeDoubleArray(double[] value)Creates a double array entry value.static NetworkTableValuemakeDoubleArray(double[] value, long time)Creates a double array entry value.static NetworkTableValuemakeDoubleArray(Number[] value)Creates a double array entry value.static NetworkTableValuemakeDoubleArray(Number[] value, long time)Creates a double array entry value.static NetworkTableValuemakeRaw(byte[] value)Creates a raw entry value.static NetworkTableValuemakeRaw(byte[] value, long time)Creates a raw entry value.static NetworkTableValuemakeRpc(byte[] value)Creates a rpc entry value.static NetworkTableValuemakeRpc(byte[] value, long time)Creates a rpc entry value.static NetworkTableValuemakeString(String value)Creates a string entry value.static NetworkTableValuemakeString(String value, long time)Creates a string entry value.static NetworkTableValuemakeStringArray(String[] value)Creates a string array entry value.static NetworkTableValuemakeStringArray(String[] value, long time)Creates a string array entry value.
-
-
-
Method Detail
-
getType
public NetworkTableType getType()
Get the data type.- Returns:
- The type.
-
getValue
public Object getValue()
Get the data value stored.- Returns:
- The type.
-
getTime
public long getTime()
Get the creation time of the value.- Returns:
- The time, in the units returned by NetworkTablesJNI.now().
-
isValid
public boolean isValid()
Determine if entry value contains a value or is unassigned.- Returns:
- True if the entry value contains a value.
-
isBoolean
public boolean isBoolean()
Determine if entry value contains a boolean.- Returns:
- True if the entry value is of boolean type.
-
isDouble
public boolean isDouble()
Determine if entry value contains a double.- Returns:
- True if the entry value is of double type.
-
isString
public boolean isString()
Determine if entry value contains a string.- Returns:
- True if the entry value is of string type.
-
isRaw
public boolean isRaw()
Determine if entry value contains a raw.- Returns:
- True if the entry value is of raw type.
-
isRpc
public boolean isRpc()
Determine if entry value contains a rpc definition.- Returns:
- True if the entry value is of rpc definition type.
-
isBooleanArray
public boolean isBooleanArray()
Determine if entry value contains a boolean array.- Returns:
- True if the entry value is of boolean array type.
-
isDoubleArray
public boolean isDoubleArray()
Determine if entry value contains a double array.- Returns:
- True if the entry value is of double array type.
-
isStringArray
public boolean isStringArray()
Determine if entry value contains a string array.- Returns:
- True if the entry value is of string array type.
-
getBoolean
public boolean getBoolean()
Get the entry's boolean value.- Returns:
- The boolean value.
- Throws:
ClassCastException- if the entry value is not of boolean type.
-
getDouble
public double getDouble()
Get the entry's double value.- Returns:
- The double value.
- Throws:
ClassCastException- if the entry value is not of double type.
-
getString
public String getString()
Get the entry's string value.- Returns:
- The string value.
- Throws:
ClassCastException- if the entry value is not of string type.
-
getRaw
public byte[] getRaw()
Get the entry's raw value.- Returns:
- The raw value.
- Throws:
ClassCastException- if the entry value is not of raw type.
-
getRpc
public byte[] getRpc()
Get the entry's rpc definition value.- Returns:
- The rpc definition value.
- Throws:
ClassCastException- if the entry value is not of rpc definition type.
-
getBooleanArray
public boolean[] getBooleanArray()
Get the entry's boolean array value.- Returns:
- The boolean array value.
- Throws:
ClassCastException- if the entry value is not of boolean array type.
-
getDoubleArray
public double[] getDoubleArray()
Get the entry's double array value.- Returns:
- The double array value.
- Throws:
ClassCastException- if the entry value is not of double array type.
-
getStringArray
public String[] getStringArray()
Get the entry's string array value.- Returns:
- The string array value.
- Throws:
ClassCastException- if the entry value is not of string array type.
-
makeBoolean
public static NetworkTableValue makeBoolean(boolean value)
Creates a boolean entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeBoolean
public static NetworkTableValue makeBoolean(boolean value, long time)
Creates a boolean entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeDouble
public static NetworkTableValue makeDouble(double value)
Creates a double entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeDouble
public static NetworkTableValue makeDouble(double value, long time)
Creates a double entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeString
public static NetworkTableValue makeString(String value)
Creates a string entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeString
public static NetworkTableValue makeString(String value, long time)
Creates a string entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeRaw
public static NetworkTableValue makeRaw(byte[] value)
Creates a raw entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeRaw
public static NetworkTableValue makeRaw(byte[] value, long time)
Creates a raw entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeRpc
public static NetworkTableValue makeRpc(byte[] value)
Creates a rpc entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeRpc
public static NetworkTableValue makeRpc(byte[] value, long time)
Creates a rpc entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeBooleanArray
public static NetworkTableValue makeBooleanArray(boolean[] value)
Creates a boolean array entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeBooleanArray
public static NetworkTableValue makeBooleanArray(boolean[] value, long time)
Creates a boolean array entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeBooleanArray
public static NetworkTableValue makeBooleanArray(Boolean[] value)
Creates a boolean array entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeBooleanArray
public static NetworkTableValue makeBooleanArray(Boolean[] value, long time)
Creates a boolean array entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeDoubleArray
public static NetworkTableValue makeDoubleArray(double[] value)
Creates a double array entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeDoubleArray
public static NetworkTableValue makeDoubleArray(double[] value, long time)
Creates a double array entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeDoubleArray
public static NetworkTableValue makeDoubleArray(Number[] value)
Creates a double array entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeDoubleArray
public static NetworkTableValue makeDoubleArray(Number[] value, long time)
Creates a double array entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
makeStringArray
public static NetworkTableValue makeStringArray(String[] value)
Creates a string array entry value.- Parameters:
value- the value- Returns:
- The entry value
-
makeStringArray
public static NetworkTableValue makeStringArray(String[] value, long time)
Creates a string array entry value.- Parameters:
value- the valuetime- the creation time to use (instead of the current time)- Returns:
- The entry value
-
-