public interface Field extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
addSample(DeviceUID n,
Object v)
Add a neighbor/value pair to this Field.
|
boolean |
containsNode(DeviceUID n) |
Iterable<Pair<DeviceUID,Object>> |
coupleIterator() |
Class<?> |
getExpectedType() |
Object |
getSample(DeviceUID n)
Get the value associated with a neighbor by this Field.
|
boolean |
isEmpty() |
Iterable<DeviceUID> |
nodeIterator() |
DeviceUID |
reduceKeys(BinaryOperator<DeviceUID> op,
DeviceUID exclude)
Apply an operator to reduce over the set of all devices, selecting a
single device.
|
Pair<DeviceUID,Object> |
reducePairs(BinaryOperator<Pair<DeviceUID,Object>> accumulator,
DeviceUID exclude)
Apply an operator to reduce over the set of all device/value pairs,
selecting a single pair.
|
Object |
reduceVals(BinaryOperator<Object> op,
DeviceUID exclude,
Object defaultVal)
Apply an operator to reduce over the set of all values, selecting a
single value.
|
Object |
removeSample(DeviceUID n)
Remove a neighbor/value pair from this Field.
|
int |
size() |
Iterable<Object> |
valIterator() |
void addSample(DeviceUID n, Object v)
n
- Neighbor to addv
- Value associated with the neighborObject removeSample(DeviceUID n)
n
- Neighbor to removeObject getSample(DeviceUID n)
n
- NeighborDeviceUID reduceKeys(BinaryOperator<DeviceUID> op, DeviceUID exclude)
op
- Order-insensitive operator to reduce devices in pairsexclude
- Device to be excluded (typically self), or null if all devices
are to be consideredObject reduceVals(BinaryOperator<Object> op, DeviceUID exclude, Object defaultVal)
op
- Order-insensitive operator to reduce values, two at a time,
starting with the defaultexclude
- Device to be excluded (typically self), or null if all devices
are to be considereddefaultVal
- The value to return if the field contains no devices or only
the excluded devicePair<DeviceUID,Object> reducePairs(BinaryOperator<Pair<DeviceUID,Object>> accumulator, DeviceUID exclude)
accumulator
- Order-insensitive operator to reduce pairs, two at a time,
starting with the defaultexclude
- Device to be excluded (typically self), or null if all devices
are to be consideredIterable<Pair<DeviceUID,Object>> coupleIterator()
int size()
boolean isEmpty()
boolean containsNode(DeviceUID n)
n
- The device being checked forClass<?> getExpectedType()