|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opcfoundation.ua.utils.NumericRange
public class NumericRange
A helper class for defining index ranges according to the OPC UA specification. The index ranges are transferred as string values, but are easier to use with the NumericRange.
| Constructor Summary | |
|---|---|
NumericRange()
Constructor for NumericRange. |
|
NumericRange(int begin)
Initializes the object with a begin index. |
|
NumericRange(int[]... indexes)
Initializes the range with the default indexes. |
|
NumericRange(int begin,
int end)
Initializes the object with a begin and end index. |
|
| Method Summary | |
|---|---|
boolean |
ensureValid(int count)
Tests the bounds are valid values for a collection with the specified length. |
boolean |
ensureValid(Object value)
Ensures the bounds are valid values for the object passed in. |
boolean |
equals(Object obj)
|
int |
getBegin()
Getter for the field begin. |
int |
getBegin(int dim)
Get the beginning of the range for the specified dimension. |
int |
getDimensions()
The number of dimensions in the range. |
static NumericRange |
getEmpty()
getEmpty. |
int |
getEnd()
Getter for the field end. |
int |
getEnd(int dim)
Get the end of the range for the specified dimension. |
boolean |
isEmpty()
Checks if the defined range is empty. |
boolean |
isEmpty(int dim)
Checks if the defined range for the specified dimension is empty. |
static boolean |
isNullOrEmpty(NumericRange indexRange)
Check if the range is an empty range. |
static NumericRange |
parse(String textToParse)
Parses a string representing a numeric range. |
void |
setBegin(int value)
Define the begin index of the range for the first dimension. |
void |
setBegin(int dim,
int value)
Define the begin index of the range for the specified dimension. |
void |
setDimensions(int dimensions)
Define the number of dimensions for the NumericRange. |
void |
setEnd(int value)
Define the end index of the range for the first dimension. |
void |
setEnd(int dim,
int value)
Define the end index of the range for the specified dimension. |
String |
toString()
|
static String |
toString(NumericRange indexRange)
toString. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NumericRange()
Constructor for NumericRange.
public NumericRange(int begin)
begin - a int.
public NumericRange(int begin,
int end)
begin - a int.end - a int.public NumericRange(int[]... indexes)
indexes - the indexes to use for initializing the range. Each element is
expected to define an array of [begin, end] indexes or just
[begin].| Method Detail |
|---|
public boolean ensureValid(Object value)
Returns false if the object is not indexable or if the numeric range is out of bounds.
value - a Object object.
public boolean ensureValid(int count)
Returns false if the numeric range is out of bounds.
count - a int.
public int getBegin()
Getter for the field begin.
public int getEnd()
Getter for the field end.
public int getBegin(int dim)
dim - the dimension, minimum 0
public int getEnd(int dim)
dim - the dimension, minimum 0
public void setBegin(int value)
value - the begin indexpublic void setEnd(int value)
value - the end index
public void setBegin(int dim,
int value)
setDimensions(int) must be called first to define the
number of dimensions in the range.
dim - the dimension, minimum 0value - the begin index
public void setEnd(int dim,
int value)
setDimensions(int) must be called first to define the number of
dimensions in the range.
dim - the dimension, minimum 0value - the end indexpublic static NumericRange getEmpty()
getEmpty.
NumericRange object.
public static NumericRange parse(String textToParse)
throws ServiceResultException
textToParse - a String object.
ServiceResultException - in case the range is not in proper formatpublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic void setDimensions(int dimensions)
dimensions - the number of dimensions for the range; must be greater than 0public int getDimensions()
public boolean isEmpty()
public boolean isEmpty(int dim)
dim - the dimension to check
public static boolean isNullOrEmpty(NumericRange indexRange)
isEmpty() check.
indexRange - the range to check.
isEmpty()public static String toString(NumericRange indexRange)
toString.
indexRange - a NumericRange object.
String object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||