|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.lang.Value
edu.iu.cnets.klatsch.lang.VNumber
public class VNumber
Both numeric and floating-point values are subsumed into this class.
Field Summary | |
---|---|
double |
val
the value actually being stored |
Constructor Summary | |
---|---|
VNumber(double val)
Initialize a new numeric value. |
|
VNumber(java.lang.Double val)
Initialize a new numeric value. |
|
VNumber(int val)
Initialize a new numeric value. |
|
VNumber(java.lang.Integer val)
Initialize a new numeric value. |
Method Summary | |
---|---|
Value |
method_str(Value... args)
n.str() : Convert the number to a string. |
VNumber |
requireRange(double min,
double max)
Require this number be in a particular range to avoid causing an error. |
java.lang.String |
toJson()
Create a JSON represention of this number. |
java.lang.String |
toString()
Convert this number to a string representation. |
Methods inherited from class edu.iu.cnets.klatsch.lang.Value |
---|
require, requireCount, requireType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final double val
Constructor Detail |
---|
public VNumber(double val)
val
- the numberpublic VNumber(java.lang.Double val)
val
- the numberpublic VNumber(int val)
val
- the numberpublic VNumber(java.lang.Integer val)
val
- the numberMethod Detail |
---|
public VNumber requireRange(double min, double max) throws EvaluationException
min
- the minimum permissible valuemax
- the maximum permissible value
EvaluationException
- if the value is out of rangepublic java.lang.String toString()
toString
in class Value
public java.lang.String toJson()
toJson
in class Value
public Value method_str(Value... args) throws EvaluationException
EvaluationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |