info.sswap.http.representation
Class ValueBase

java.lang.Object
  extended by info.sswap.http.representation.ValueBase
All Implemented Interfaces:
Value
Direct Known Subclasses:
ArrayValue, Entity, LiteralValue

public abstract class ValueBase
extends java.lang.Object
implements Value


Constructor Summary
ValueBase()
           
 
Method Summary
 Value[] asArray()
          Gets the representation of this value as an array of values.
 boolean asBoolean()
          Gets the boolean representation of this value
 double asDouble()
          Returns the representation of this value as a double
 Entity asEntity()
          Returns the value as an entity
 int asInteger()
          Returns the representation of this value as an integer
 LiteralValue asLiteral()
          Returns this value as a literal.
 java.lang.String asString()
          Returns the representation of this value as string (without the quotes).
 boolean isArray()
          Checks whether this value is an array of values.
 boolean isBoolean()
          Checks whether this value can be as a boolean (i.e., contains "true" or "false", case insensitive)
 boolean isDouble()
          Checks whether this value can be represented as a double
 boolean isEntity()
          Checks whether this value is an entity.
 boolean isInteger()
          Checks whether this value is a valid integer.
 boolean isLiteral()
          Checks whether this value is a literal (i.e., not an array or entity)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueBase

public ValueBase()
Method Detail

isLiteral

public boolean isLiteral()
Description copied from interface: Value
Checks whether this value is a literal (i.e., not an array or entity)

Specified by:
isLiteral in interface Value
Returns:
true if this value is a literal

asLiteral

public LiteralValue asLiteral()
Description copied from interface: Value
Returns this value as a literal.

Specified by:
asLiteral in interface Value
Returns:
this value typed as LiteralValue

asArray

public Value[] asArray()
Description copied from interface: Value
Gets the representation of this value as an array of values.

Specified by:
asArray in interface Value
Returns:
the representation of this value as an array

asBoolean

public boolean asBoolean()
Description copied from interface: Value
Gets the boolean representation of this value

Specified by:
asBoolean in interface Value
Returns:
true if the value contains "true" (case insensitive), false otherwise

asDouble

public double asDouble()
Description copied from interface: Value
Returns the representation of this value as a double

Specified by:
asDouble in interface Value
Returns:
the representation of this value as a double

asEntity

public Entity asEntity()
Description copied from interface: Value
Returns the value as an entity

Specified by:
asEntity in interface Value
Returns:
the representation of this value as an entity

asInteger

public int asInteger()
Description copied from interface: Value
Returns the representation of this value as an integer

Specified by:
asInteger in interface Value
Returns:
the representation of this value as an integer

asString

public java.lang.String asString()
Description copied from interface: Value
Returns the representation of this value as string (without the quotes).

Specified by:
asString in interface Value
Returns:
the string representation of this value

isArray

public boolean isArray()
Description copied from interface: Value
Checks whether this value is an array of values.

Specified by:
isArray in interface Value
Returns:
true if the value is an array

isBoolean

public boolean isBoolean()
Description copied from interface: Value
Checks whether this value can be as a boolean (i.e., contains "true" or "false", case insensitive)

Specified by:
isBoolean in interface Value
Returns:
true if this value can be a boolean, false otherwise

isDouble

public boolean isDouble()
Description copied from interface: Value
Checks whether this value can be represented as a double

Specified by:
isDouble in interface Value
Returns:
true if this is a valid double, false otherwise

isEntity

public boolean isEntity()
Description copied from interface: Value
Checks whether this value is an entity.

Specified by:
isEntity in interface Value
Returns:
true if this value is an entity

isInteger

public boolean isInteger()
Description copied from interface: Value
Checks whether this value is a valid integer.

Specified by:
isInteger in interface Value
Returns:
true, if this is a valid integer, false otherwise


Copyright (c) 2010, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.