|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.bioinfweb.treegraph.document.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 String |
text
|
Constructor Summary | |
---|---|
TextElementData()
|
|
TextElementData(double decimal)
|
|
TextElementData(String string)
|
Method Summary | |
---|---|
void |
assign(TextElementData other)
|
void |
clear()
Clears this object. |
TextElementData |
clone()
|
boolean |
equals(Object other)
|
static String |
formatTextElement(TextElement element)
Returns the formatted value of the given text element. |
String |
formatValue(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. |
String |
getText()
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 |
setText(String stringValue)
|
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 |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String text
private double decimal
Constructor Detail |
---|
public TextElementData()
public TextElementData(String string)
public TextElementData(double decimal)
Method Detail |
---|
public double getDecimal()
Double.NaN
is no decimal is stored.
public void setDecimal(double doubleValue)
public String getText()
null
is no string is stored.
public void setText(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 String formatValue(DecimalFormat format)
format
- the format-object to format a possibly contained decimal value
public static String formatTextElement(TextElement element)
element
- the element to be formatted
public String toString()
null
if the object is empty.
Object.toString()
public void assign(TextElementData other)
public boolean equals(Object other)
public TextElementData clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |