|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectplatypus.Value<A>
public class Value<A>
Class that contains a value and the line number of its last modification. Uses generics. Note: because of the use of generics, getValue() returns a *string*. This should be converted to the right numeric type through the usual Java library methods.
| Field Summary | |
|---|---|
private int |
lineNumber
the input line # at which value was set |
private A |
value
the actual value (of unknown type) |
| Constructor Summary | |
|---|---|
Value(A initialValue)
|
|
Value(A val,
int line)
|
|
| Method Summary | |
|---|---|
java.lang.String |
dump()
Creates a partial string containing the dump information for the value. |
int |
getLineNumber()
Returns an integer containing the line number of when the value was last modified |
java.lang.String |
getValue()
In a parameterized class, this returns an Object even if declared as A getValue(), so instead return a string and convert it at point of use via Float.valueOf(), Integer.valueOf(), Boolean.valueOf, etc. |
A |
setValue(A newValue)
Setter for value (but returns set value object as a convenience. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private A value
private int lineNumber
| Constructor Detail |
|---|
public Value(A initialValue)
public Value(A val,
int line)
| Method Detail |
|---|
public java.lang.String getValue()
public int getLineNumber()
public A setValue(A newValue)
newValue - the value to set value to.
public java.lang.String dump()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||