|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.bioinfweb.treegraph.document.TextElementData
public class TextElementData
This class is used to store data of tree elements which can either be a string or a decimal value.
| Field Summary | |
|---|---|
private double |
decimal
|
private java.lang.String |
string
|
| Constructor Summary | |
|---|---|
TextElementData()
|
|
TextElementData(double decimal)
|
|
TextElementData(java.lang.String string)
|
|
| Method Summary | |
|---|---|
void |
assign(TextElementData other)
|
void |
clear()
Clears this object. |
TextElementData |
clone()
|
static java.lang.String |
formatTextElement(TextElement element)
Returns the formatted value of the given text element. |
java.lang.String |
formatValue(java.text.DecimalFormat format)
Return the contained string or the contained formated decimal value or an empty string is the object contains no data. |
double |
getDecimal()
Return the stored decimal value or Double.NaN is no decimal is stored. |
java.lang.String |
getString()
Returns the stored string value or null is no string is stored. |
boolean |
isDecimal()
Return whether this object contains a decimal value. |
boolean |
isEmpty()
Return whether this object is empty. |
boolean |
isString()
Return whether this object contains a string value. |
void |
setDecimal(double doubleValue)
|
void |
setString(java.lang.String stringValue)
|
java.lang.String |
toString()
Returns either the stored string, the decimal value as a sting or null
if the object is empty. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String string
private double decimal
| Constructor Detail |
|---|
public TextElementData()
public TextElementData(java.lang.String string)
public TextElementData(double decimal)
| Method Detail |
|---|
public double getDecimal()
Double.NaN is no decimal is stored.
public void setDecimal(double doubleValue)
public java.lang.String getString()
null is no string is stored.
public void setString(java.lang.String stringValue)
public void clear()
isEmpty()public boolean isString()
false does not necessarily mean that a decimal value is contained. This
object could also be empty.
true if the stored value is a stringisDecimal(),
isEmpty()public boolean isDecimal()
false does not necessarily mean that a string value is contained. This
object could also be empty.
true if the stored value is a decimnalisString(),
isEmpty()public boolean isEmpty()
true if there is no value storedisDecimal(),
isString()public java.lang.String formatValue(java.text.DecimalFormat format)
format - - the format-object to format a possibly contained decimal value
public static java.lang.String formatTextElement(TextElement element)
element - - the element to be formatted
public java.lang.String toString()
null
if the object is empty.
toString in class java.lang.ObjectObject.toString()public void assign(TextElementData other)
public TextElementData clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||