|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectspark.data.SV
public class SV
This is a general container for Spark data values. A value object can store any of the valid data types (long, double, boolean, string, object, array).
Constructor Summary | |
---|---|
SV()
Creates an SV with a NULL type |
|
SV(boolean val)
Creates an SV with a BOOLEAN type |
|
SV(double val)
Creates an SV with a DOUBLE type |
|
SV(long val)
Creates an SV with a LONG type |
|
SV(SA val)
Creates an SV with an ARRAY type |
|
SV(SO val)
Creates an SV with an OBJECT type |
|
SV(java.lang.String val)
Creates an SV with a STRING type |
Method Summary | |
---|---|
static SV |
askFile()
|
static SV |
askFile(java.lang.String[] pkgs)
|
boolean |
equals(SV v)
|
SV |
expand(SO model)
|
SV |
get(int idx)
|
SV |
get(java.lang.String name)
|
double |
getDouble()
if the type is DOUBLE or LONG then the value is returned, otherwise an exception is thrown. |
long |
getLong()
if the type is LONG then the value is returned, otherwise an exception is thrown. |
SA |
getSA()
if the type is ARRAY then the value is returned, otherwise an exception is thrown. |
SO |
getSO()
if the type is OBJECT then the value is returned, otherwise an exception is thrown. |
java.lang.String |
getString()
if the type is STRING then the value is returned, otherwise an exception is thrown. |
boolean |
isBoolean()
|
boolean |
isDouble()
|
boolean |
isLong()
|
boolean |
isSA()
|
boolean |
isSO()
|
boolean |
isString()
|
boolean |
isTrue()
if the type is BOOLEAN then the value is returned, otherwise an exception is thrown. |
static SV |
json(java.lang.String source)
This will parse a string in JSON format and return the corresponding SV. |
static SV |
json(java.lang.String[] pkgs,
java.lang.String source)
This will parse a string in JSON format using class names only from the specified packages. |
boolean |
match(SA a)
|
boolean |
match(SO o)
|
boolean |
match(SV v)
|
void |
outJSON()
This will write this SV to System.out in JSON form using fully qualified _class: names. |
void |
outJSON(java.lang.String[] pkgs)
This will write an SV to System.out in JSON format using classes from the specified list of packages. |
void |
outSON()
This will write this SV to System.out SON form using fully qualified class names. |
void |
outSON(java.lang.String[] pkgs)
This will write an SV to System.out in SON format using classes from the specified list of packages. |
void |
set(boolean val)
Changes the value to a BOOLEAN |
void |
set(double val)
Changes the value to a DOUBLE |
void |
set(long val)
Changes the value to a LONG |
void |
set(SA val)
Changes the value to an ARRAY |
void |
set(SO val)
Changes the value to an OBJECT |
void |
set(java.lang.String val)
Changes the value to a STRING |
static SV |
son(java.lang.String source)
This will parse a string in SON format and return the corresponding SV. |
static SV |
son(java.lang.String[] pkgs,
java.lang.String source)
This will parse a string in SON format using class names only from the specified packages. |
java.lang.String |
toString()
|
SVal |
type()
Returns the type of value stored. |
java.lang.String |
typeName()
Returns the string name of the type of this object |
static SV |
url(java.lang.String theURL)
This will read an SV from a file referenced by a URL. |
static SV |
url(java.lang.String[] pkgs,
java.lang.String theURL)
This will read an SV from a file referenced by a URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SV()
public SV(long val)
val
- the long valuepublic SV(double val)
val
- the double valuepublic SV(boolean val)
val
- the boolean valuepublic SV(java.lang.String val)
val
- the string valuepublic SV(SO val)
val
- the SO valuepublic SV(SA val)
val
- the array valueMethod Detail |
---|
public SVal type()
public void set(long val)
val
- the new valuepublic long getLong()
public void set(double val)
val
- the new valuepublic double getDouble()
public void set(boolean val)
val
- the new valuepublic boolean isTrue()
public SV get(java.lang.String name)
public SV get(int idx)
public boolean isLong()
public boolean isDouble()
public boolean isBoolean()
public boolean isString()
public boolean isSO()
public boolean isSA()
public void set(java.lang.String val)
val
- the new valuepublic java.lang.String getString()
public void set(SO val)
val
- the new valuepublic SO getSO()
public void set(SA val)
val
- the new valuepublic SA getSA()
public java.lang.String typeName()
public java.lang.String toString()
toString
in class java.lang.Object
public void outJSON()
public void outJSON(java.lang.String[] pkgs)
pkgs
- a list of packages from which class names are drawn.public void outSON()
public void outSON(java.lang.String[] pkgs)
pkgs
- a list of packages from which class names are drawn.public static SV json(java.lang.String source)
source
- the string from which the JSON is to be parsed.
public static SV json(java.lang.String[] pkgs, java.lang.String source)
pkgs
- these are names of the only packages from which
class names can be drawn.source
- the string to be parsed.
public static SV son(java.lang.String source)
source
- the string from which the SON is to be parsed.
public static SV son(java.lang.String[] pkgs, java.lang.String source)
pkgs
- these are names of the only packages from which
class names can be drawn.source
- the string to be parsed.
public static SV url(java.lang.String theURL)
theURL
- a fully qualified URL from which data
can be read.
java.lang.RuntimeException
- if there are any URL errors or parsing errors.public static SV url(java.lang.String[] pkgs, java.lang.String theURL)
pkgs
- the list of packages from which objects can be created.theURL
- the URL for where the data is to be read.
java.lang.RuntimeException
- if there are any URL errors or parsing errors.public static SV askFile()
public static SV askFile(java.lang.String[] pkgs)
public boolean match(SV v)
public boolean match(SO o)
public boolean match(SA a)
public boolean equals(SV v)
public SV expand(SO model)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |