|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.joost.stx.Value
public class Value
Container class for concrete values (of XPath types)
Field Summary | |
---|---|
private boolean |
bool
for
|
static int |
BOOLEAN
type constant |
static int |
EMPTY
type constant |
private SAXEvent |
event
for
|
Value |
next
The next value of the sequence. |
static int |
NODE
type constant |
private double |
number
for
|
static int |
NUMBER
type constant |
private static NumberFormat |
numberFormat
|
private Object |
object
for
|
static int |
OBJECT
type constant |
private String |
string
for
|
static int |
STRING
type constant |
int |
type
type of this value |
static Value |
VAL_EMPTY
|
static Value |
VAL_EMPTY_STRING
|
static Value |
VAL_FALSE
|
static Value |
VAL_NAN
|
static Value |
VAL_TRUE
|
static Value |
VAL_ZERO
|
Constructor Summary | |
---|---|
private |
Value()
Constructs an empty sequence |
private |
Value(boolean b)
Constructs a Value containing a boolean |
|
Value(CharSequence s)
Constructs a Value containing a string |
|
Value(double d)
Constructs a Value containing a number |
|
Value(Object obj)
Constructs a Value containing a custom Java object,
possibly converting the object to a known STX type |
|
Value(SAXEvent e)
Constructs a Value containing a node
( ). |
Method Summary | |
---|---|
static Value |
concat(Value v1,
Value v2)
Creates a sequence by concatenating two values (which are possibly already sequences |
Value |
copy()
Creates a full copy of the sequence represented by this value. |
static Value |
getBoolean(boolean b)
Returns a Value object representing the given boolean value |
boolean |
getBooleanValue()
returns the value of this object converted to a boolean |
double |
getDistanceTo(Class target)
Determines the conversion distance of the contained value to the specified target Java class. |
SAXEvent |
getNode()
|
double |
getNumberValue()
returns the value of this object converted to a number |
Object |
getObject()
|
String |
getString()
|
String |
getStringValue()
returns the value of this object converted to a string |
Value |
singleCopy()
Returns a single value that is a copy of this value |
Object |
toJavaObject(Class target)
Converts this value to a Java object. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static NumberFormat numberFormat
public static final Value VAL_TRUE
public static final Value VAL_FALSE
public static final Value VAL_EMPTY
public static final Value VAL_EMPTY_STRING
public static final Value VAL_ZERO
public static final Value VAL_NAN
public static final int EMPTY
public static final int NODE
public static final int BOOLEAN
public static final int NUMBER
public static final int STRING
public static final int OBJECT
public int type
private SAXEvent event
type
== NODE
private boolean bool
type
== BOOLEAN
private double number
type
== NUMBER
private String string
type
== STRING
private Object object
type
== OBJECT
public Value next
type
set to NODE
and event
set to
null
(next
must be null
in
this case, too).
Constructor Detail |
---|
private Value()
public Value(double d)
Value
containing a number
private Value(boolean b)
Value
containing a boolean
public Value(CharSequence s)
Value
containing a string
public Value(SAXEvent e)
Value
containing a node
(SAXEvent
).
e
- the eventpublic Value(Object obj)
Value
containing a custom Java object,
possibly converting the object to a known STX type
Method Detail |
---|
public static Value getBoolean(boolean b)
public String getString()
public SAXEvent getNode()
public Object getObject()
public double getNumberValue()
public String getStringValue()
public boolean getBooleanValue()
public Value copy()
public Value singleCopy()
public static Value concat(Value v1, Value v2)
v1
- first value (first part of the resulting sequence)v2
- second value (second part of the resulting sequence)
public double getDistanceTo(Class target)
target
- the class to which a conversion is desired
Double.POSITIVE_INFINITY
if a conversion is not possiblepublic Object toJavaObject(Class target) throws EvalException
EvalException
- if the conversion is not possiblepublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |