public class Variant
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Variant.ListT
Value used for constructing a list type variant.
|
static class |
Variant.NullT
Value used for constructing a NULL type variant.
|
static class |
Variant.Types
Available variant types.
|
| Constructor and Description |
|---|
Variant()
Defines an empty variant class.
|
Variant(int id,
byte[] val)
Constructor, defines a byte array type variant class.
|
Variant(int id,
double val)
Constructor, defines a floating point type variant class.
|
Variant(int id,
float val)
Constructor, defines a floating point type variant class.
|
Variant(int id,
Frame frame)
Constructor, defines a frame type variant class.
|
Variant(int id,
int val)
Constructor, defines an integer type variant class.
|
Variant(int id,
int[] val)
Constructor, defines an integer array type variant class.
|
Variant(int id,
long val)
Constructor, defines a long type variant class.
|
Variant(int id,
java.lang.String val)
Constructor, defines a string type variant class.
|
Variant(int id,
Variant.ListT listT)
Constructor, defines a list type variant class.
|
Variant(int id,
Variant.NullT nullt)
Constructor, defines a NULL type variant class.
|
Variant(java.lang.String name,
byte[] val)
Constructor, defines a byte array type variant class.
|
Variant(java.lang.String name,
double val)
Constructor, defines a floating point type variant class.
|
Variant(java.lang.String name,
float val)
Constructor, defines a floating point type variant class.
|
Variant(java.lang.String name,
Frame frame)
Constructor, defines a frame type variant class.
|
Variant(java.lang.String name,
int val)
Constructor, defines an integer type variant class.
|
Variant(java.lang.String name,
int[] val)
Constructor, defines an integer array type variant class.
|
Variant(java.lang.String name,
long val)
Constructor, defines a long type variant class.
|
Variant(java.lang.String name,
java.lang.String val)
Constructor, defines a string type variant class.
|
Variant(java.lang.String name,
Variant.ListT listT)
Constructor, defines a list type variant class.
|
Variant(java.lang.String name,
Variant.NullT nullt)
Constructor, defines a NULL type variant class.
|
Variant(Variant source)
References an existing variant.
|
| Modifier and Type | Method and Description |
|---|---|
Variant |
addChild(Variant item)
Adds a child element to the variant.
|
Variant |
addChild(Variant item,
VariantPos position)
Adds a child element to the variant.
|
Variant |
addListItem(Variant item)
Adds an item to the list type variant.
|
Variant |
addListItem(Variant item,
VariantPos position)
Adds an item to the list type variant.
|
Variant |
at(int ix)
Returns an item of the list type variant.
|
Variant |
changeToList()
Modifies an existing variant to list type.
|
Variant |
clear()
Modifies an existing variant to NULL type.
|
Variant |
create(int id,
java.lang.String name)
Creates a NULL type variant structure.
|
Variant |
create(int id,
java.lang.String name,
double data)
Creates a floating point type variant structure.
|
Variant |
create(int id,
java.lang.String name,
float data)
Creates a floating point type variant structure.
|
Variant |
create(int id,
java.lang.String name,
Frame data)
Creates a frame type variant structure.
|
Variant |
create(int id,
java.lang.String name,
int data)
Creates an integer type variant structure.
|
Variant |
create(int id,
java.lang.String name,
long data)
Creates a long type variant structure.
|
Variant |
create(int id,
java.lang.String name,
java.lang.String data)
Creates a string type variant structure.
|
Variant |
createArray(int id,
java.lang.String name,
byte[] varray)
Creates a byte type variant array structure.
|
Variant |
createArray(int id,
java.lang.String name,
int[] varray)
Creates and integer type variant array structure.
|
Variant |
createList(int id,
java.lang.String name)
Creates a list type variant structure.
|
Variant |
duplicate()
Duplicates, copies the variant and all of its descendants.
|
Variant |
getChild(int id,
int ix)
Returns a child of a variant.
|
Variant |
getChild(java.lang.String name,
int ix)
Returns a child of a variant.
|
Variant |
getChild(VariantPos position)
Returns a child of a variant.
|
Variant |
getChildByIndex(int ix)
Returns a child of a variant.
|
int |
getId()
Returns the Id of the variant.
|
Variant |
getItemByPath(java.lang.String path)
Returns a variant from a tree.
|
Variant |
getListItem(int ix)
Returns an item of the list type variant.
|
Variant |
getListItem(VariantPos position)
Returns an item of the list type variant.
|
java.lang.String |
getName()
Returns the name of the variant.
|
int |
getNChildren()
Returns the number of children in the variant.
|
int |
getNItems()
Returns the number of items in the variant.
|
int |
getSize()
Returns the item size of the variant.
|
Variant.Types |
getType()
Returns the type of the variant.
|
Variant |
leave()
Finishes working with the actual variant object.
|
Variant |
member(int id)
Returns a child of a variant.
|
Variant |
member(int id,
int ix)
Returns a child of a variant.
|
Variant |
member(java.lang.String name)
Returns a child of a variant.
|
Variant |
member(java.lang.String name,
int ix)
Returns a child of a variant.
|
Variant |
ref()
References an existing variant to enable multiple Disposing.
|
Variant |
setId(int id)
Sets the Id of the variant.
|
Variant |
setName(java.lang.String name)
Sets the name of the variant.
|
byte[] |
toByteArray()
Returns the value of the variant converted to byte array.
|
double |
toDouble()
Returns the value of the variant converted to floating point.
|
float |
toFloat()
Returns the value of the variant converted to floating point.
|
Frame |
toFrame()
Returns the value of the variant converted to frame.
|
int |
toInt()
Returns the value of the variant converted to integer.
|
int[] |
toIntArray()
Returns the value of the variant converted to integer array.
|
long |
toLong()
Returns the value of the variant converted to long.
|
java.lang.String |
toString()
Returns the value of the variant converted to string.
|
java.lang.String |
toStringEx()
Returns the value of the variant converted to string or throws an exception.
|
Variant |
update(double data)
Modifies the type and the value of an existing variant.
|
Variant |
update(float data)
Modifies the type and the value of an existing variant.
|
Variant |
update(Frame data)
Modifies the type and the value of an existing variant.
|
Variant |
update(int data)
Modifies the type and the value of an existing variant.
|
Variant |
update(long data)
Modifies the type and the value of an existing variant.
|
Variant |
update(java.lang.String data)
Modifies the type and the value of an existing variant.
|
Variant |
updateArray(byte[] varray)
Modifies the type and the value of an existing variant.
|
Variant |
updateArray(int[] varray)
Modifies the type and the value of an existing variant.
|
public Variant()
public Variant(Variant source) throws General
source - Source variant.Generalpublic Variant(int id,
Variant.NullT nullt)
throws General
id - The Id of the variant.nullt - Value used for constructing a NULL type variant.Generalpublic Variant(java.lang.String name,
Variant.NullT nullt)
throws General
name - The name of the variant.nullt - Value used for constructing a NULL type variant.Generalpublic Variant(int id,
int val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
int val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
long val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
long val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
float val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
float val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
double val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
double val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
java.lang.String val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
java.lang.String val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
int[] val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
int[] val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
byte[] val)
throws General
id - The Id of the variant.val - The value of the variant.Generalpublic Variant(java.lang.String name,
byte[] val)
throws General
name - The name of the variant.val - The value of the variant.Generalpublic Variant(int id,
Frame frame)
throws General
id - The Id of the variant.frame - The value of the variant.Generalpublic Variant(java.lang.String name,
Frame frame)
throws General
name - The name of the variant.frame - The value of the variant.Generalpublic Variant(int id,
Variant.ListT listT)
throws General
id - The Id of the variant.listT - Value used for constructing a list type variant.Generalpublic Variant(java.lang.String name,
Variant.ListT listT)
throws General
name - The name of the variant.listT - Value used for constructing a list type variant.Generalpublic Variant leave() throws General
Generalpublic int getId()
throws General
Generalpublic Variant setId(int id) throws General
id - The new Id of the variant.Generalpublic java.lang.String getName()
throws General
Generalpublic Variant setName(java.lang.String name) throws General
name - The new name of the variant.Generalpublic Variant.Types getType() throws General
Generalpublic int getSize()
throws General
Generalpublic int getNItems()
throws General
Generalpublic Variant duplicate() throws General
Generalpublic final Variant ref() throws General
Generalpublic final Variant create(int id, java.lang.String name) throws General
id - The Id of the variant.name - The name of the variant.Generalpublic final Variant clear() throws General
Generalpublic final Variant create(int id, java.lang.String name, int data) throws General
id - The Id of the variant.name - The name of the variant.data - The value of the variant.Generalpublic Variant update(int data) throws General
data - The value of the variant.Generalpublic int toInt()
throws General
Generalpublic final Variant create(int id, java.lang.String name, long data) throws General
id - The Id of the variant.name - The name of the variant.data - The value of the variant.Generalpublic Variant update(long data) throws General
data - The value of the variant.Generalpublic long toLong()
throws General
Generalpublic final Variant create(int id, java.lang.String name, float data) throws General
id - The Id of the variant.name - The name of the variant.data - The value of the variant.Generalpublic Variant update(float data) throws General
data - The value of the variant.Generalpublic float toFloat()
throws General
Generalpublic final Variant create(int id, java.lang.String name, double data) throws General
id - The Id of the variant.name - The name of the variant.data - The value of the variant.Generalpublic Variant update(double data) throws General
data - The value of the variant.Generalpublic double toDouble()
throws General
Generalpublic final Variant create(int id, java.lang.String name, java.lang.String data) throws General
id - The Id of the variant.name - The name of the variant.data - The value of the variant.Generalpublic Variant update(java.lang.String data) throws General
data - The value of the variant.Generalpublic java.lang.String toStringEx()
throws General
Generalpublic java.lang.String toString()
toString in class java.lang.Objectpublic final Variant createArray(int id, java.lang.String name, int[] varray) throws General
id - The Id of the variant.name - The name of the variant.varray - The array.Generalpublic Variant updateArray(int[] varray) throws General
varray - The array.Generalpublic int[] toIntArray()
throws General
Generalpublic final Variant createArray(int id, java.lang.String name, byte[] varray) throws General
id - The Id of the variant.name - The name of the variant.varray - The array.Generalpublic Variant updateArray(byte[] varray) throws General
varray - The array.Generalpublic byte[] toByteArray()
throws General
Generalpublic final Variant create(int id, java.lang.String name, Frame data) throws General
id - The Id of the variant.name - The name of the variant.data - The value of the variant.Generalpublic Variant update(Frame data) throws General
data - The value of the variant.Generalpublic Frame toFrame() throws General
Generalpublic Variant at(int ix) throws General
ix - The index of the requested item.Generalpublic final Variant createList(int id, java.lang.String name) throws General
id - The Id of the variant.name - The name of the variant.Generalpublic Variant changeToList() throws General
Generalpublic Variant addListItem(Variant item) throws General
item - The item to add to the list.Generalpublic Variant addListItem(Variant item, VariantPos position) throws General
item - The item to add to the list.position - The position to insert or append the new item.Generalpublic Variant getListItem(int ix) throws General
ix - The index of the requested item.Generalpublic Variant getListItem(VariantPos position) throws General
position - The position of the requested item.Generalpublic Variant member(int id) throws General
id - The Id of the requested child.Generalpublic Variant member(int id, int ix) throws General
id - The Id of the requested child.ix - The index of the requested child.Generalpublic Variant member(java.lang.String name) throws General
name - The name of the requested child.Generalpublic Variant member(java.lang.String name, int ix) throws General
name - The name of the requested child.ix - The index of the requested child.Generalpublic int getNChildren()
throws General
Generalpublic Variant addChild(Variant item) throws General
item - The new child to add to the children list.Generalpublic Variant addChild(Variant item, VariantPos position) throws General
item - The new child to add to the children list.position - The position to insert or append the new child.Generalpublic Variant getChildByIndex(int ix) throws General
ix - The index of the requested child.Generalpublic Variant getChild(int id, int ix) throws General
id - The Id of the requested child.ix - The index of the requested child.Generalpublic Variant getChild(java.lang.String name, int ix) throws General
name - The name of the requested child.ix - The index of the requested child.Generalpublic Variant getChild(VariantPos position) throws General
position - The position of the requested child.Generalpublic Variant getItemByPath(java.lang.String path) throws General
getChild(VariantPos position) and
getListItem(VariantPos position) methods.
If there is a need to reach a descendant variant located on a lower
level, this method should be used instead. The item in the tree can be
obtained by the path string that defines the exact location of the
requested variant and has the following format:
condition[=value] [,condition[=value]] [/condition[=value]
[,condition[=value]]]
The path contains separators:
'/' separates the levels of the tree,
',' separates the search conditions of a node,
'=' signs that a value follows,
and identifiers:
'C' selects a child item,
'L' selects a list item,
'X' signs that the value defines the index of the item,
'D' signs that the value defines the Id of the item,
'N' signs that the value defines the name of the item,
'V' signs that the value defines the value of the item.
The values are used as integers except 'name' values that have to be quoted with " or ' character; and 'value' values that may be quoted with " or ' character to sign that string comparison is required. Indexing is made by order.
path - The path string.GeneralARH Passport Reader v 2.2.0.17 / 2017 July 19 14:58