com.caucho.quercus.env
Class LongValue

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.NumberValue
          extended by com.caucho.quercus.env.LongValue
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LongCacheValue

public class LongValue
extends NumberValue

Represents a PHP long value.

See Also:
Serialized Form

Field Summary
static LongValue MINUS_ONE
           
static LongValue ONE
           
static int STATIC_MAX
           
static int STATIC_MIN
           
static LongCacheValue[] STATIC_VALUES
           
static LongValue ZERO
           
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
LongValue(long value)
           
 
Method Summary
 Value abs()
          Absolute value.
 Value add(long lLong)
          Adds to the following value.
 Value add(Value value)
          Adds to the following value.
 Value addOne()
          The next integer
 StringValue appendTo(BinaryBuilderValue sb)
          Append to a binary builder.
 StringValue appendTo(LargeStringBuilderValue sb)
          Append to a string builder.
 StringValue appendTo(StringBuilderValue sb)
          Append to a string builder.
 StringValue appendTo(UnicodeBuilderValue sb)
          Append to a unicode builder.
 int cmp(Value rValue)
          Returns true for equality
static LongValue create(long value)
           
static LongValue 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)
          Post-increment the following value.
 boolean isDouble()
          Returns true for a double-value.
 boolean isEmpty()
          Returns true if the value is empty
 boolean isLong()
          Returns true for a long-value.
 boolean isLongConvertible()
          Returns true for a long.
 boolean isNumeric()
          Returns true for is_numeric
 boolean isScalar()
          Returns true for a scalar
 Value neg()
          Negates the value.
 long nextIndex(long oldIndex)
          Returns the next array index based on this value.
 Value pos()
          Negates the value.
 Value postdecr()
          Post-decrement the following value.
 Value postincr()
          Post-increment the following value.
 Value predecr()
          Pre-increment the following value.
 Value preincr()
          Pre-increment the following value.
 void print(Env env)
          Prints the value.
 void serialize(Env env, java.lang.StringBuilder sb)
          Serializes the value.
 Value sub(long rLong)
          Subtracts the following value.
 Value sub(Value rValue)
          Subtracts to the following value.
 Value subOne()
          The previous integer
 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
 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
 LongValue toLongValue()
          Converts to a long value
 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
compareNum, jsonEncode
 
Methods inherited from class com.caucho.quercus.env.Value
append, 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, isDoubleConvertible, isFieldInit, isNull, isNumberConvertible, isObject, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, key, keyExists, length, leq, lshift, lt, mod, mul, mul, next, 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, toArgRef, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBooleanMarshalCost, toByteArrayMarshalCost, toCallable, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDoubleValue, 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, 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

MINUS_ONE

public static final LongValue MINUS_ONE

ZERO

public static final LongValue ZERO

ONE

public static final LongValue ONE

STATIC_MIN

public static final int STATIC_MIN
See Also:
Constant Field Values

STATIC_MAX

public static final int STATIC_MAX
See Also:
Constant Field Values

STATIC_VALUES

public static final LongCacheValue[] STATIC_VALUES
Constructor Detail

LongValue

public LongValue(long value)
Method Detail

create

public static LongValue create(long value)

create

public static LongValue 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

isLongConvertible

public boolean isLongConvertible()
Returns true for a long.

Overrides:
isLongConvertible in class Value

isNumeric

public boolean isNumeric()
Returns true for is_numeric

Overrides:
isNumeric 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

isScalar

public boolean isScalar()
Returns true for a scalar


isEmpty

public boolean isEmpty()
Returns true if the value is empty

Overrides:
isEmpty in class Value

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

toString

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

Overrides:
toString in class java.lang.Object

toStringBuilder

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

Overrides:
toStringBuilder in class Value

toLongValue

public LongValue toLongValue()
Converts to a long value

Overrides:
toLongValue in class Value

toKey

public Value toKey()
Converts to a key.

Overrides:
toKey in class Value

toObject

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


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()
Negates the value.

Overrides:
pos in class Value

addOne

public Value addOne()
The next integer

Overrides:
addOne in class Value

subOne

public Value subOne()
The previous integer

Overrides:
subOne in class Value

preincr

public Value preincr()
Pre-increment the following value.

Overrides:
preincr in class Value

predecr

public Value predecr()
Pre-increment the following value.

Overrides:
predecr in class Value

postincr

public Value postincr()
Post-increment the following value.

Overrides:
postincr in class Value

postdecr

public Value postdecr()
Post-decrement the following value.

Overrides:
postdecr in class Value

increment

public Value increment(int incr)
Post-increment the following value.

Overrides:
increment in class Value

add

public Value add(Value value)
Adds to the following value.

Overrides:
add in class Value

add

public Value add(long lLong)
Adds to the following value.

Overrides:
add in class Value

sub

public Value sub(Value rValue)
Subtracts to the following value.

Overrides:
sub in class Value

sub

public Value sub(long rLong)
Subtracts the following value.

Overrides:
sub 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

cmp

public int cmp(Value rValue)
Returns true for equality

Overrides:
cmp in class NumberValue

nextIndex

public long nextIndex(long oldIndex)
Returns the next array index based on this value.

Overrides:
nextIndex in class Value

print

public void print(Env env)
Prints the value.

Overrides:
print in class Value
Parameters:
env -

appendTo

public StringValue appendTo(UnicodeBuilderValue sb)
Append to a unicode builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(BinaryBuilderValue sb)
Append to a binary builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(StringBuilderValue sb)
Append to a string builder.

Overrides:
appendTo in class Value

appendTo

public StringValue appendTo(LargeStringBuilderValue sb)
Append to a string builder.

Overrides:
appendTo in class Value

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 final 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