com.caucho.quercus.env
Class DoubleValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.NumberValue
          extended by com.caucho.quercus.env.DoubleValue
All Implemented Interfaces:
java.io.Serializable

public class DoubleValue
extends NumberValue
implements java.io.Serializable

Represents a PHP double value.

See Also:
Serialized Form

Field Summary
static DoubleValue ZERO
           
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
DoubleValue(double value)
           
 
Method Summary
 Value abs()
          Absolute value.
 Value add(long lValue)
          Multiplies to the following value.
 Value add(Value rValue)
          Multiplies to the following value.
 Value addOne()
          Increment the following value.
static DoubleValue create(double value)
           
static Value create(java.lang.Number value)
           
 boolean eql(Value rValue)
          Returns true for equality
 boolean equals(java.lang.Object o)
          Compare for equality.
 void generate(java.io.PrintWriter out)
          Generates code to recreate the expression.
 java.lang.String getType()
          Returns the type.
 ValueType getValueType()
          Returns the ValueType.
 int hashCode()
          Returns the hash code
 Value increment(int incr)
          Increment the following value.
 boolean isDouble()
          Returns true for a double-value.
 boolean isDoubleConvertible()
          Returns true for a double.
 boolean isLong()
          Returns true for a long-value.
 boolean isLongConvertible()
          Returns true for integer looking doubles.
 boolean isNumeric()
          Returns true for is_numeric
 boolean isScalar()
          Returns true for a scalar
 Value mul(long lValue)
          Multiplies to the following value.
 Value mul(Value rValue)
          Multiplies to the following value.
 Value neg()
          Negates the value.
 Value pos()
          Returns the value
 Value postdecr()
          Increment the following value.
 Value postincr()
          Increment the following value.
 Value predecr()
          Increment the following value.
 Value preincr()
          Increment the following value.
 void print(Env env)
          Prints the value.
 void serialize(Env env, java.lang.StringBuilder sb)
          Serializes the value.
 Value subOne()
          Increment the following value.
 boolean toBoolean()
          Converts to a boolean.
 int toByteMarshalCost()
          Cost to convert to a byte
 double toDouble()
          Converts to a double.
 int toDoubleMarshalCost()
          Cost to convert to a double
 DoubleValue toDoubleValue()
          Converts to a double.
 int toIntegerMarshalCost()
          Cost to convert to an integer
 java.lang.Object toJavaObject()
          Converts to a java object.
 Value toKey()
          Converts to a key.
 long toLong()
          Converts to a long.
 int toLongMarshalCost()
          Cost to convert to a long
 java.lang.Object toObject()
          Converts to an object.
 int toShortMarshalCost()
          Cost to convert to a short
 java.lang.String toString()
          Converts to a string.
 StringValue toStringBuilder(Env env)
          Converts to a string builder
 void varDumpImpl(Env env, WriteStream out, int depth, java.util.IdentityHashMap<Value,java.lang.String> valueSet)
           
 void varExport(java.lang.StringBuilder sb)
          Exports the value.
 
Methods inherited from class com.caucho.quercus.env.NumberValue
cmp, compareNum, jsonEncode
 
Methods inherited from class com.caucho.quercus.env.Value
append, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, call, callCopy, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callMethodRef, callRef, callRef, callRef, callRef, callRef, callRef, callRef, charValueAt, checkPrivate, checkProtected, clone, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eq, eqValue, findFunction, geq, get, getArg, getArray, getArray, getBaseIterator, getCallableName, getCalledClass, getClassName, getCount, getCountRecursive, getDirty, getField, getFieldArg, getFieldArgRef, getFieldArray, getFieldObject, getFieldVar, getHashCode, getIterator, getKeyArray, getKeyIterator, getObject, getObject, getQuercusClass, getRef, getResourceType, getSize, getThisField, getThisFieldArg, getThisFieldArgRef, getThisFieldArray, getThisFieldObject, getThisFieldVar, getValueArray, getValueIterator, getVar, gt, hasCurrent, initField, isA, isA, isArray, isBinary, isBoolean, isCallable, isDefault, isEmpty, isFieldInit, isNull, isNumberConvertible, isObject, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, key, keyExists, length, leq, lshift, lt, mod, next, nextIndex, pop, postincr, preincr, prev, print, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, put, put, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, rshift, serialize, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, sub, sub, toArgRef, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBooleanMarshalCost, toByteArrayMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toException, toFloatMarshalCost, toInputStream, toInt, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLongValue, toObject, toRef, toRefValue, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final DoubleValue ZERO
Constructor Detail

DoubleValue

public DoubleValue(double value)
Method Detail

create

public static DoubleValue create(double value)

create

public static Value create(java.lang.Number value)

getType

public java.lang.String getType()
Returns the type.

Overrides:
getType in class Value

getValueType

public ValueType getValueType()
Returns the ValueType.

Overrides:
getValueType in class Value

isDoubleConvertible

public boolean isDoubleConvertible()
Returns true for a double.

Overrides:
isDoubleConvertible in class Value

isLongConvertible

public boolean isLongConvertible()
Returns true for integer looking doubles.

Overrides:
isLongConvertible in class Value

isLong

public boolean isLong()
Returns true for a long-value.

Overrides:
isLong in class Value

isDouble

public boolean isDouble()
Returns true for a double-value.

Overrides:
isDouble in class Value

isNumeric

public boolean isNumeric()
Returns true for is_numeric

Overrides:
isNumeric in class Value

isScalar

public boolean isScalar()
Returns true for a scalar


toDoubleMarshalCost

public int toDoubleMarshalCost()
Cost to convert to a double

Overrides:
toDoubleMarshalCost in class Value

toLongMarshalCost

public int toLongMarshalCost()
Cost to convert to a long

Overrides:
toLongMarshalCost in class Value

toIntegerMarshalCost

public int toIntegerMarshalCost()
Cost to convert to an integer

Overrides:
toIntegerMarshalCost in class Value

toShortMarshalCost

public int toShortMarshalCost()
Cost to convert to a short

Overrides:
toShortMarshalCost in class Value

toByteMarshalCost

public int toByteMarshalCost()
Cost to convert to a byte

Overrides:
toByteMarshalCost in class Value

toBoolean

public boolean toBoolean()
Converts to a boolean.

Overrides:
toBoolean in class Value

toLong

public long toLong()
Converts to a long.

Overrides:
toLong in class Value

toDouble

public double toDouble()
Converts to a double.

Overrides:
toDouble in class Value

toDoubleValue

public DoubleValue toDoubleValue()
Converts to a double.

Overrides:
toDoubleValue in class Value

toStringBuilder

public StringValue toStringBuilder(Env env)
Converts to a string builder

Overrides:
toStringBuilder in class Value

toKey

public Value toKey()
Converts to a key.

Overrides:
toKey in class Value

toJavaObject

public java.lang.Object toJavaObject()
Converts to a java object.

Overrides:
toJavaObject in class Value

neg

public Value neg()
Negates the value.

Overrides:
neg in class Value

pos

public Value pos()
Returns the value

Overrides:
pos in class Value

add

public Value add(Value rValue)
Multiplies to the following value.

Overrides:
add in class Value

add

public Value add(long lValue)
Multiplies to the following value.

Overrides:
add in class Value

addOne

public Value addOne()
Increment the following value.

Overrides:
addOne in class Value

subOne

public Value subOne()
Increment the following value.

Overrides:
subOne in class Value

preincr

public Value preincr()
Increment the following value.

Overrides:
preincr in class Value

predecr

public Value predecr()
Increment the following value.

Overrides:
predecr in class Value

postincr

public Value postincr()
Increment the following value.

Overrides:
postincr in class Value

postdecr

public Value postdecr()
Increment the following value.

Overrides:
postdecr in class Value

increment

public Value increment(int incr)
Increment the following value.

Overrides:
increment in class Value

mul

public Value mul(Value rValue)
Multiplies to the following value.

Overrides:
mul in class Value

mul

public Value mul(long lValue)
Multiplies to the following value.

Overrides:
mul in class Value

abs

public Value abs()
Absolute value.

Overrides:
abs in class Value

eql

public boolean eql(Value rValue)
Returns true for equality

Overrides:
eql in class Value

toString

public java.lang.String toString()
Converts to a string.

Overrides:
toString in class java.lang.Object
Parameters:
env -

toObject

public java.lang.Object toObject()
Converts to an object.


print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

serialize

public void serialize(Env env,
                      java.lang.StringBuilder sb)
Serializes the value.

Overrides:
serialize in class Value

varExport

public void varExport(java.lang.StringBuilder sb)
Exports the value.

Overrides:
varExport in class Value

generate

public void generate(java.io.PrintWriter out)
              throws java.io.IOException
Generates code to recreate the expression.

Overrides:
generate in class Value
Parameters:
out - the writer to the Java source code.
Throws:
java.io.IOException

hashCode

public int hashCode()
Returns the hash code

Overrides:
hashCode in class Value

equals

public boolean equals(java.lang.Object o)
Compare for equality.

Overrides:
equals in class java.lang.Object

varDumpImpl

public void varDumpImpl(Env env,
                        WriteStream out,
                        int depth,
                        java.util.IdentityHashMap<Value,java.lang.String> valueSet)
                 throws java.io.IOException
Overrides:
varDumpImpl in class Value
Throws:
java.io.IOException