org.stanwood.media.source.xbmc.expression
Class Value

java.lang.Object
  extended by org.stanwood.media.source.xbmc.expression.Value
Direct Known Subclasses:
BooleanValue, IntegerValue, StringValue

public class Value
extends java.lang.Object

This class is the base class for Values returned by the expersion evaluator


Constructor Summary
Value(ValueType type, java.lang.Object value)
          The constructor
 
Method Summary
 Value addition(Value value)
          Used to add this value to another value
 Value and(Value value)
          Used to 'and' the parameter value from with value
 Value divide(Value value)
          Used to divide this value with another value
 Value equals(Value value)
          Used to perform a == operation between this value and the value in the parameter
 ValueType getType()
          Used to get the type of the value
 java.lang.Object getValue()
          Used to get the raw value
 Value greater(Value value)
          Used to perform a > operation between this value and the value in the parameter
 Value greaterEquals(Value value)
          Used to perform a >= operation between this value and the value in the parameter
 Value less(Value value)
          Used to perform a < operation between this value and the value in the parameter
 Value lessEquals(Value value)
          Used to perform a <= operation between this value and the value in the parameter
 Value multiply(Value value)
          Used to multiply this value with another value
 Value not()
          Used to perform a not operation on this value and return the result
 Value notequals(Value value)
          Used to perform a != operation between this value and the value in the parameter
 Value or(Value value)
          Used to 'or' the parameter value from with value
 void setType(ValueType type)
          Used to set the type of the value
 void setValue(java.lang.Object value)
          Used to set the raw value
 Value subtract(Value value)
          Used to subtract the parameter value from this value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Value

public Value(ValueType type,
             java.lang.Object value)
The constructor

Parameters:
type - The type of value
value - The raw value
Method Detail

getValue

public java.lang.Object getValue()
Used to get the raw value

Returns:
The raw value

setValue

public void setValue(java.lang.Object value)
Used to set the raw value

Parameters:
value - The raw value

getType

public ValueType getType()
Used to get the type of the value

Returns:
The type of the value

setType

public void setType(ValueType type)
Used to set the type of the value

Parameters:
type - The type of the value

addition

public Value addition(Value value)
               throws ExpressionParserException
Used to add this value to another value

Parameters:
value - The value to add this value to
Returns:
The added values
Throws:
ExpressionParserException - Thrown if their is a problem performing the operation.

divide

public Value divide(Value value)
             throws ExpressionParserException
Used to divide this value with another value

Parameters:
value - The value to divide this value by
Returns:
The result of the operation
Throws:
ExpressionParserException - Thrown if their is a problem performing the operation.

multiply

public Value multiply(Value value)
               throws ExpressionParserException
Used to multiply this value with another value

Parameters:
value - The value to multiply this value by
Returns:
The result of the operation
Throws:
ExpressionParserException - Thrown if their is a problem performing the operation.

subtract

public Value subtract(Value value)
               throws ExpressionParserException
Used to subtract the parameter value from this value

Parameters:
value - The value to subtract
Returns:
The result of the operation
Throws:
ExpressionParserException - Thrown if not supported by this value

not

public Value not()
Used to perform a not operation on this value and return the result

Returns:
The not value of this value
Throws:
ExpressionParserException - Thrown if not supported by this value

and

public Value and(Value value)
Used to 'and' the parameter value from with value

Parameters:
value - The value to 'and' with
Returns:
The result of the operation
Throws:
ExpressionParserException - Thrown if not supported by this value

or

public Value or(Value value)
Used to 'or' the parameter value from with value

Parameters:
value - The value to 'or' with
Returns:
The result of the operation
Throws:
ExpressionParserException - Thrown if not supported by this value

notequals

public Value notequals(Value value)
Used to perform a != operation between this value and the value in the parameter

Parameters:
value - The value to perform the operation with
Returns:
The result
Throws:
ExpressionParserException - Thrown if not supported by this value

equals

public Value equals(Value value)
Used to perform a == operation between this value and the value in the parameter

Parameters:
value - The value to perform the operation with
Returns:
The result
Throws:
ExpressionParserException - Thrown if not supported by this value

greater

public Value greater(Value value)
Used to perform a > operation between this value and the value in the parameter

Parameters:
value - The value to perform the operation with
Returns:
The result
Throws:
ExpressionParserException - Thrown if not supported by this value

greaterEquals

public Value greaterEquals(Value value)
Used to perform a >= operation between this value and the value in the parameter

Parameters:
value - The value to perform the operation with
Returns:
The result
Throws:
ExpressionParserException - Thrown if not supported by this value

less

public Value less(Value value)
Used to perform a < operation between this value and the value in the parameter

Parameters:
value - The value to perform the operation with
Returns:
The result
Throws:
ExpressionParserException - Thrown if not supported by this value

lessEquals

public Value lessEquals(Value value)
Used to perform a <= operation between this value and the value in the parameter

Parameters:
value - The value to perform the operation with
Returns:
The result
Throws:
ExpressionParserException - Thrown if not supported by this value