com.caucho.el
Class DoubleLiteral

java.lang.Object
  extended by javax.el.Expression
      extended by javax.el.ValueExpression
          extended by com.caucho.el.Expr
              extended by com.caucho.el.DoubleLiteral
All Implemented Interfaces:
java.io.Serializable

public class DoubleLiteral
extends Expr

Represents a double literal expression.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.el.Expr
L, log
 
Constructor Summary
DoubleLiteral(double value)
          Create a new double literal.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true for equal longs.
 double evalDouble(ELContext env)
          Evaluate the expression as an object as a double
 long evalLong(ELContext env)
          Evaluate the expression as an object as a long.
 java.lang.Object getValue(ELContext env)
          Evaluate the expression as an object.
 boolean isConstant()
          Returns true if the expression is constant.
 boolean print(JspWriter out, ELContext env, boolean escapeXml)
          Evaluates directly to the output.
 void printCreate(WriteStream os)
          Prints the *.java code to create an DoubleLiteral.
 java.lang.String toString()
          Returns a readable representation of the expr.
 
Methods inherited from class com.caucho.el.Expr
coerceToType, createField, createField, createMethod, error, evalBigDecimal, evalBigInteger, evalBoolean, evalCharacter, evalObject, evalPeriod, evalString, evalStringWithNull, getExpectedType, getExpressionString, getMethodInfo, getType, hashCode, invocationError, invoke, isDouble, isDoubleString, isLiteralText, isReadOnly, print, printEscaped, printEscapedString, setProperty, setValue, toBigDecimal, toBigInteger, toBoolean, toCharacter, toDouble, toEnum, toLong, toStream, toStream, toStream, toStreamEscaped, toStreamEscaped, toStreamEscaped, toString, toString, toString, toString, toString, toStringWithNull
 
Methods inherited from class javax.el.ValueExpression
getValueReference
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleLiteral

public DoubleLiteral(double value)
Create a new double literal.

Method Detail

isConstant

public boolean isConstant()
Returns true if the expression is constant.

Overrides:
isConstant in class Expr

getValue

public java.lang.Object getValue(ELContext env)
                          throws ELException
Evaluate the expression as an object.

Specified by:
getValue in class Expr
Parameters:
env - the variable environment
Returns:
the Double constant
Throws:
ELException

evalLong

public long evalLong(ELContext env)
              throws ELException
Evaluate the expression as an object as a long.

Overrides:
evalLong in class Expr
Parameters:
env - the variable environment
Returns:
the double value casted to a long
Throws:
ELException

evalDouble

public double evalDouble(ELContext env)
                  throws ELException
Evaluate the expression as an object as a double

Overrides:
evalDouble in class Expr
Parameters:
env - the variable environment
Returns:
the double value
Throws:
ELException

print

public boolean print(JspWriter out,
                     ELContext env,
                     boolean escapeXml)
              throws java.io.IOException,
                     ELException
Evaluates directly to the output. The method returns true if the default value should be printed instead.

Overrides:
print in class Expr
Parameters:
out - the output writer
env - the variable environment
escapeXml - if true, escape reserved XML
Returns:
true if the object is null, otherwise false
Throws:
java.io.IOException
ELException

printCreate

public void printCreate(WriteStream os)
                 throws java.io.IOException
Prints the *.java code to create an DoubleLiteral.

Overrides:
printCreate in class Expr
Parameters:
os - the stream to the generated *.java
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object o)
Returns true for equal longs.

Overrides:
equals in class Expr

toString

public java.lang.String toString()
Returns a readable representation of the expr.

Specified by:
toString in class Expr