public interface VariableAccess_ifc
org.vishia.reflect.FieldJcVariableAccess (srcJava_vishiaRun).
A variable may be a entity in a byte-datagram, see ByteDataSymbolicAccess.Variable.
The quality of a variable and the kind of access is described in the implementation.
The user can access to a substantial variable with this interface.
org.vishia.reflect.FieldJcVariableAccess (srcJava_vishiaRun) or in data from files.
use Container List < VariableAccess_ifc > or Map < String,VariableAccess_ifc >.
To work as integral whole, this interface supports all of them.
IndexOutOfBoundsException or an IllegalArgumentException
may be thrown.| Modifier and Type | Field and Description |
|---|---|
static int |
version
Version, history and license.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getDouble()
Gets the value from this variable.
|
float |
getFloat()
Gets the value from this variable.
|
int |
getInt()
Gets a integer value from this variable.
|
long |
getLastRefreshTime()
Gets the time stamp when this variable was refreshed lastly.
|
int[] |
getLastRefreshTimeShort()
Returns a pair of timeShort and timeShortAdd (see
Timeshort)
of the last refresh time if timeAbs is not available
or the necessary resolution should be finer than 1 ms. |
long |
getLong()
Gets a long value from this variable.
|
java.lang.String |
getString()
Gets the value from this variable.
|
char |
getType()
Returns the type of the variable:
|
boolean |
isRefreshed()
Returns true if the variable was refreshed after it was requested.
|
boolean |
isRequestedValue(long timeEarlyRequested,
boolean retryFaultyVariables)
Returns true if the request is newer than the last refresh.
|
void |
requestValue()
Requests a new value from the target device with the
System.currentTimeMillis() |
void |
requestValue(long timeRequested)
Requests a new value from the target device.
|
void |
requestValue(long timeRequested,
java.lang.Runnable run)
Requests a new value from the target device.
|
double |
setDouble(double value)
Sets the value from this variable.
|
float |
setFloat(float value)
Sets the value from this variable.
|
int |
setInt(int value)
Sets the value into the variable.
|
long |
setLong(long value)
Sets the value into the variable.
|
void |
setRefreshed(long time) |
java.lang.String |
setString(java.lang.String value)
Sets the value into the variable
|
static final int version
getLastRefreshTimeShort()
isRequestedValue(long, boolean) with time parameter for earliest request.
isRefreshed(), implemented in all implementors.
int getInt()
ixArray - unused if it isn't an indexed variable.int setInt(int value)
value - The value given as int.ixArray - unused if it isn't an indexed variable.long getLong()
ixArray - unused if it isn't an indexed variable.long setLong(long value)
value - The value given as int.ixArray - unused if it isn't an indexed variable.float getFloat()
ixArray - unused if it isn't an indexed variable.float setFloat(float value)
ixArray - unused if it isn't an indexed variable.double getDouble()
ixArray - unused if it isn't an indexed variable.double setDouble(double value)
ixArray - unused if it isn't an indexed variable.java.lang.String getString()
ixArray - unused if it isn't an indexed variable.java.lang.String setString(java.lang.String value)
value - The value given as String.ixArray - unused if it isn't an indexed variable.void requestValue(long timeRequested)
timeRequested - the current time, used to mark the request.void requestValue()
System.currentTimeMillis()void requestValue(long timeRequested,
java.lang.Runnable run)
timeRequested - the current timerun - method which should be invoked if the request is resolved, optional operation.boolean isRequestedValue(long timeEarlyRequested,
boolean retryFaultyVariables)
timeEarlyRequested - The earliest time where the variable is requested. If the request time is more early, it is not regarded.
This is since 2016-01. An old request should be ignored but the time stamp of the request should be visible for debug or view the state.retryFaultyVariables - A variable which is set to invalid is requested though.boolean isRefreshed()
void setRefreshed(long time)
long getLastRefreshTime()
int[] getLastRefreshTimeShort()
Timeshort)
of the last refresh time if timeAbs is not available
or the necessary resolution should be finer than 1 ms.char getType()