Package edu.wpi.first.networktables
Interface GenericSubscriber
- All Superinterfaces:
AutoCloseable,PubSub,Subscriber,Supplier<NetworkTableValue>
- All Known Subinterfaces:
GenericEntry
NetworkTables generic subscriber.
-
Method Summary
Modifier and TypeMethodDescriptionget()Get the last published value.booleangetBoolean(boolean defaultValue) Gets the entry's value as a boolean.boolean[]getBooleanArray(boolean[] defaultValue) Gets the entry's value as a boolean[].Boolean[]getBooleanArray(Boolean[] defaultValue) Gets the entry's value as a boolean array.doublegetDouble(double defaultValue) Gets the entry's value as a double.double[]getDoubleArray(double[] defaultValue) Gets the entry's value as a double[].Double[]getDoubleArray(Double[] defaultValue) Gets the entry's value as a boolean array.floatgetFloat(float defaultValue) Gets the entry's value as a float.float[]getFloatArray(float[] defaultValue) Gets the entry's value as a float[].Float[]getFloatArray(Float[] defaultValue) Gets the entry's value as a boolean array.longgetInteger(long defaultValue) Gets the entry's value as a long.long[]getIntegerArray(long[] defaultValue) Gets the entry's value as a long[].Long[]getIntegerArray(Long[] defaultValue) Gets the entry's value as a boolean array.byte[]getRaw(byte[] defaultValue) Gets the entry's value as a byte[].Gets the entry's value as a String.String[]getStringArray(String[] defaultValue) Gets the entry's value as a String[].getTopic()Get the corresponding topic.Get an array of all value changes since the last call to readQueue.Methods inherited from interface edu.wpi.first.networktables.Subscriber
exists, getLastChange
-
Method Details
-
getTopic
Get the corresponding topic. -
get
Get the last published value. If no value has been published, returns a value with type NetworkTableType.kUnassigned.- Specified by:
getin interfaceSupplier<NetworkTableValue>- Returns:
- value
-
getBoolean
Gets the entry's value as a boolean. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getInteger
Gets the entry's value as a long. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getFloat
Gets the entry's value as a float. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getDouble
Gets the entry's value as a double. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getString
Gets the entry's value as a String. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getRaw
Gets the entry's value as a byte[]. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getBooleanArray
Gets the entry's value as a boolean[]. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getBooleanArray
Gets the entry's value as a boolean array. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getIntegerArray
Gets the entry's value as a long[]. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getIntegerArray
Gets the entry's value as a boolean array. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getFloatArray
Gets the entry's value as a float[]. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getFloatArray
Gets the entry's value as a boolean array. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getDoubleArray
Gets the entry's value as a double[]. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getDoubleArray
Gets the entry's value as a boolean array. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
getStringArray
Gets the entry's value as a String[]. If the entry does not exist or is of different type, it will return the default value.- Parameters:
defaultValue- the value to be returned if no value is found- Returns:
- the entry's value or the given default value
-
readQueue
Get an array of all value changes since the last call to readQueue. Also provides a timestamp for each value.The "poll storage" subscribe option can be used to set the queue depth.
- Returns:
- Array of timestamped values; empty array if no new changes have been published since the previous call.
-