|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.BitHelper
com.tangosol.util.ExternalizableHelper
com.tangosol.run.xml.SimpleValue
public class SimpleValue
A simple implementation of the XmlValue interface. Protected methods are provided to support inheriting classes.
Field Summary |
---|
Fields inherited from interface com.tangosol.run.xml.XmlValue |
---|
TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATETIME, TYPE_DECIMAL, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_STRING, TYPE_TIME |
Constructor Summary | |
---|---|
SimpleValue() Construct an empty SimpleValue. |
|
SimpleValue(Object oValue) Construct a SimpleValue. |
|
SimpleValue(Object oValue, boolean fAttribute) Construct a SimpleValue. |
|
SimpleValue(Object oValue, boolean fAttribute, boolean fReadOnly) Construct a SimpleValue. |
Method Summary | |
---|---|
Object |
clone() Creates and returns a copy of this SimpleValue. |
protected Object |
convert(Object o, int nType) Convert the passed Object to the specified type. |
protected Object |
ensureType(int nType) Change the type of the internal representation of the XmlValue. |
boolean |
equals(Object o) Compare this XML value with another XML value for equality. |
Binary |
getBinary() Get the value as binary. |
Binary |
getBinary(Binary binDefault) Get the value as binary. |
boolean |
getBoolean() Get the value as a boolean. |
boolean |
getBoolean(boolean fDefault) Get the value as a boolean. |
Date |
getDate() Get the value as a Date. |
Date |
getDate(Date dtDefault) Get the value as a Date. |
Timestamp |
getDateTime() Get the value as a Timestamp. |
Timestamp |
getDateTime(Timestamp dtDefault) Get the value as a Timestamp. |
BigDecimal |
getDecimal() Get the value as a decimal. |
BigDecimal |
getDecimal(BigDecimal decDefault) Get the value as a decimal. |
double |
getDouble() Get the value as a double. |
double |
getDouble(double dflDefault) Get the value as a double. |
int |
getInt() Get the value as an int. |
int |
getInt(int nDefault) Get the value as an int. |
protected Object |
getInternalValue() Get the internal value of this XmlValue. |
long |
getLong() Get the value as a long. |
long |
getLong(long lDefault) Get the value as a long. |
XmlElement |
getParent() Get the parent element of this element. |
String |
getString() Get the value as a String. |
String |
getString(String sDefault) Get the value as a String. |
Time |
getTime() Get the value as a Time. |
Time |
getTime(Time dtDefault) Get the value as a Time. |
Object |
getValue() Get the value as an Object. |
int |
hashCode() Provide a hash value for this XML value. |
boolean |
isAttribute() Determine if this value is an element attribute. |
boolean |
isContent() Determine if this value is an element's content. |
boolean |
isEmpty() Determine if the value is empty. |
boolean |
isMutable() Determine if this value can be modified. |
void |
readExternal(DataInput in) Restore the contents of this object by loading the object's state from the passed DataInput object. |
void |
readExternal(PofReader in) Restore the contents of a user type instance by reading its state using the specified PofReader object. |
protected void |
setAttribute(boolean fAttribute) Specify that this value is an element attribute. |
void |
setBinary(Binary binVal) Set the binary value. |
void |
setBoolean(boolean fVal) Set the boolean value. |
void |
setDate(Date dtVal) Set the Date value. |
void |
setDateTime(Timestamp dtVal) Set the Timestamp value. |
void |
setDecimal(BigDecimal decVal) Set the dcimal value. |
void |
setDouble(double dflVal) Set the double value. |
void |
setInt(int nVal) Set the int value. |
protected void |
setInternalValue(Object oValue) Update the internal representation of the XmlValue. |
void |
setLong(long lVal) Set the long value. |
protected void |
setMutable(boolean fMutable) Specify whether this value can be modified or not. |
void |
setParent(XmlElement element) Set the parent element of this value. |
void |
setString(String sVal) Set the String value. |
void |
setTime(Time dtVal) Set the Time value. |
String |
toString() Format the XML value into a String in a display format. |
void |
writeExternal(DataOutput out) Save the contents of this object by storing the object's state into the passed DataOutput object. |
void |
writeExternal(PofWriter out) Save the contents of a POF user type instance by writing its state using the specified PofWriter object. |
void |
writeValue(PrintWriter out, boolean fPretty) Write the value as it will appear in XML. |
Methods inherited from class com.tangosol.util.BitHelper |
---|
countBits, countBits, countBits, indexOfLSB, indexOfLSB, indexOfLSB, indexOfMSB, indexOfMSB, indexOfMSB, rotateLeft, rotateLeft, rotateLeft, rotateRight, rotateRight, rotateRight, toBitString, toBitString, toBitString |
Constructor Detail |
---|
public SimpleValue()
public SimpleValue(Object oValue)
oValue
- the initial value for this SimpleValueIllegalArgumentException
- if the String value is illegalpublic SimpleValue(Object oValue, boolean fAttribute)
oValue
- the initial value for this SimpleValuefAttribute
- true if this SimpleValue is an element attribute value; false if an element's content's valueIllegalArgumentException
- if the String value is illegalpublic SimpleValue(Object oValue, boolean fAttribute, boolean fReadOnly)
oValue
- the initial value for this SimpleValuefAttribute
- true if this SimpleValue is an element attribute value; false if an element's content's valuefReadOnly
- true if this SimpleValue is intended to be read- only once the constructor has finishedIllegalArgumentException
- if the String value is illegalMethod Detail |
---|
public boolean getBoolean()
getBoolean
in interface XmlValue
public boolean getBoolean(boolean fDefault)
getBoolean
in interface XmlValue
fDefault
- the default return value if the internal value can not be translated into a legal value of type booleanpublic void setBoolean(boolean fVal)
setBoolean
in interface XmlValue
fVal
- a new value of type booleanpublic int getInt()
getInt
in interface XmlValue
public int getInt(int nDefault)
getInt
in interface XmlValue
nDefault
- the default return value if the internal value can not be translated into a legal value of type intpublic void setInt(int nVal)
setInt
in interface XmlValue
nVal
- a new value of type intpublic long getLong()
getLong
in interface XmlValue
public long getLong(long lDefault)
getLong
in interface XmlValue
lDefault
- the default return value if the internal value can not be translated into a legal value of type longpublic void setLong(long lVal)
setLong
in interface XmlValue
lVal
- a new value of type longpublic double getDouble()
getDouble
in interface XmlValue
public double getDouble(double dflDefault)
getDouble
in interface XmlValue
dflDefault
- the default return value if the internal value can not be translated into a legal value of type doublepublic void setDouble(double dflVal)
setDouble
in interface XmlValue
dflVal
- a new value of type doublepublic BigDecimal getDecimal()
getDecimal
in interface XmlValue
public BigDecimal getDecimal(BigDecimal decDefault)
getDecimal
in interface XmlValue
decDefault
- the default return value if the internal value can not be translated into a legal value of type decimalpublic void setDecimal(BigDecimal decVal)
setDecimal
in interface XmlValue
decVal
- a new value of type BigDecimalpublic String getString()
getString
in interface XmlValue
public String getString(String sDefault)
getString
in interface XmlValue
sDefault
- the default return value if the internal value can not be translated into a legal value of type Stringpublic void setString(String sVal)
setString
in interface XmlValue
sVal
- a new value of type StringIllegalArgumentException
- if the String value is nullpublic Binary getBinary()
getBinary
in interface XmlValue
public Binary getBinary(Binary binDefault)
getBinary
in interface XmlValue
binDefault
- the default return value if the internal value can not be translated into a legal value of type Binarypublic void setBinary(Binary binVal)
setBinary
in interface XmlValue
binVal
- a new value of type BinaryIllegalArgumentException
- if the binary value is nullpublic Date getDate()
getDate
in interface XmlValue
public Date getDate(Date dtDefault)
getDate
in interface XmlValue
dtDefault
- the default return value if the internal value can not be translated into a legal value of type Datepublic void setDate(Date dtVal)
setDate
in interface XmlValue
dtVal
- a new value of type Datepublic Time getTime()
getTime
in interface XmlValue
public Time getTime(Time dtDefault)
getTime
in interface XmlValue
dtDefault
- the default return value if the internal value can not be translated into a legal value of type Timepublic void setTime(Time dtVal)
setTime
in interface XmlValue
dtVal
- a new value of type Timepublic Timestamp getDateTime()
getDateTime
in interface XmlValue
public Timestamp getDateTime(Timestamp dtDefault)
getDateTime
in interface XmlValue
dtDefault
- the default return value if the internal value can not be translated into a legal value of type Timestamppublic void setDateTime(Timestamp dtVal)
setDateTime
in interface XmlValue
dtVal
- a new value of type Timestamppublic Object getValue()
getValue
in interface XmlValue
public XmlElement getParent()
getParent
in interface XmlValue
public void setParent(XmlElement element)
setParent
in interface XmlValue
element
- the parent elementIllegalArgumentException
- thrown if the specified parent is nullIllegalStateException
- throw if the parent is already setpublic boolean isEmpty()
isEmpty
in interface XmlValue
public boolean isAttribute()
isAttribute
in interface XmlValue
public boolean isContent()
isContent
in interface XmlValue
public boolean isMutable()
isMutable
in interface XmlValue
public void writeValue(PrintWriter out, boolean fPretty)
writeValue
in interface XmlValue
out
- a PrintWriter object to use to write tofPretty
- true to specify that the output is intended to be as human readable as possiblepublic void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore the state of this objectIOException
- if an I/O exception occursNotActiveException
- if the object is not in its initial state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object toIOException
- if an I/O exception occurspublic void readExternal(PofReader in) throws IOException
readExternal
in interface PortableObject
in
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic void writeExternal(PofWriter out) throws IOException
writeExternal
in interface PortableObject
out
- the PofWriter to which to write the object's stateIOException
- if an I/O error occursprotected Object getInternalValue()
protected void setInternalValue(Object oValue)
oValue
- the new value for this SimpleValue objectUnsupportedOperationException
- if this XmlValue is not mutableprotected Object ensureType(int nType)
nType
- the enumerated type to convert toprotected Object convert(Object o, int nType)
o
- the object valuenType
- the enumerated type to convert toprotected void setAttribute(boolean fAttribute)
fAttribute
- true if this value is an element attribute, false if this value is an element's contentprotected void setMutable(boolean fMutable)
fMutable
- pass true to allow this value to be modified, otherwise false to indicate that this value is read-onlypublic String toString()
toString
in interface XmlValue
public int hashCode()
hashCode
in interface XmlValue
public boolean equals(Object o)
equals
in interface XmlValue
public Object clone()
clone
in interface XmlValue
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |