T - type of value supported by the endpointpublic interface Endpoint<T>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Endpoint.Type
Type of value sent and/or received by an endpoint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(EndpointListener<T> el)
Add a listener to the endpoint.
|
String |
getName()
Return the name of this endpoint.
|
Register |
getRegister()
Get the register to which this endpoint is associated.
|
Endpoint.Type |
getType()
Return the type of the data supported by this endpoint
|
String |
getUnit()
Return the unit currently used for converting the endpoint values.
|
List<String> |
getUnits()
Get the units supported by this endpoint
|
T |
getValue()
returns the current value of the endpoint.
|
T |
getValue(String unit)
returns the current value of the endpoint in the given unit.
|
boolean |
hasValue()
Checks if the endpoint has a value available.
|
boolean |
isOutput()
Test if the endpoint is an output or just an input.
|
void |
removeListener(EndpointListener<T> el)
Remove a listener from the endpoint.
|
void |
setUnit(String unit)
Set the unit to use for converting endpoint values.
|
void |
setValue(String unit,
T value)
set the value of the endpoint
|
void |
setValue(T value)
set the value of the endpoint
|
String getName()
Endpoint.Type getType()
List<String> getUnits()
String getUnit()
void setUnit(String unit) throws me.legrange.panstamp.NoSuchUnitException
unit - The unit to useNoSuchUnitException - Thrown if the unit specified does not exist.for more information.void addListener(EndpointListener<T> el)
el - Listener that will receive incoming datavoid removeListener(EndpointListener<T> el)
el - The listener to removeboolean hasValue()
T getValue(String unit) throws NetworkException
unit - Unit in which to receive the valueNetworkException - Thrown if there is a problem retrieving and endpoint value.T getValue() throws NetworkException
NetworkException - Thrown if there is a problem retrieving and endpoint value.void setValue(String unit, T value) throws NetworkException
unit - The unit in which the value is passed.value - The value to setNetworkException - Thrown if there is a problem setting the endpoint value.void setValue(T value) throws NetworkException
value - The value to setNetworkException - Thrown if there is a problem setting the endpoint value.boolean isOutput()
Register getRegister()
Copyright © 2015. All rights reserved.