com.caucho.quercus.env
Class Closure

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.Callback
          extended by com.caucho.quercus.env.Closure
All Implemented Interfaces:
Callable, java.io.Serializable

public class Closure
extends Callback

Represents a call to a function.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
Closure(Env env, Function fun)
           
 
Method Summary
 Value call(Env env, Value[] args)
          Evaluates the callback with variable arguments.
 Value callMethod(Env env, StringValue methodName, int hash, Value[] args)
          Evaluates a method.
 java.lang.String getCallbackName()
          Returns the name of the callback.
 java.lang.String getType()
          Returns the type.
 boolean isCallable(Env env, boolean isSyntax)
           
 boolean isInternal(Env env)
          Returns true if this callback is implemented internally (i.e.
 boolean isObject()
          Returns true for an object.
 boolean isValid(Env env)
          Checks for a valid callback.
 Callable toCallable(Env env)
          Converts to a callable
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.quercus.env.Callback
callArray, callArray, callArray
 
Methods inherited from class com.caucho.quercus.env.Value
abs, add, add, addOne, append, appendTo, appendTo, appendTo, appendTo, bitAnd, bitOr, bitXor, call, call, call, call, call, call, callCopy, 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, cmp, containsKey, copy, copy, copy, copyArrayItem, copyReturn, copySaveFunArg, copyStringBuilder, copyTree, current, div, div, end, eq, eql, eqValue, findFunction, generate, 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, getValueType, getVar, gt, hasCurrent, hashCode, increment, initField, isA, isA, isArray, isBinary, isBoolean, isCallable, isDefault, isDouble, isDoubleConvertible, isEmpty, isFieldInit, isLong, isLongConvertible, isNull, isNumberConvertible, isNumeric, isResource, isset, isset, issetField, issetThisField, isString, isUnicode, isVar, jsonEncode, key, keyExists, length, leq, lshift, lt, mod, mul, mul, neg, next, nextIndex, pop, pos, postdecr, postincr, postincr, predecr, preincr, preincr, prev, print, print, printDepth, printJavaChar, printJavaString, printR, printRImpl, put, put, put, putField, putField, putField, putObject, putThisField, putThisField, putVar, remove, reset, rshift, serialize, serialize, set, setCharValueAt, setFieldInit, setJavaObject, shuffle, sub_rev, sub, sub, subOne, toArgRef, toArray, toArrayValue, toAutoArray, toAutoObject, toBigDecimal, toBigInteger, toBinaryValue, toBinaryValue, toBinaryValue, toBinaryValueMarshalCost, toBoolean, toBooleanMarshalCost, toByteArrayMarshalCost, toByteMarshalCost, toChar, toCharArrayMarshalCost, toCharMarshalCost, toDebugString, toDouble, toDoubleMarshalCost, toDoubleValue, toException, toFloatMarshalCost, toInputStream, toInt, toIntegerMarshalCost, toInternString, toJavaBoolean, toJavaByte, toJavaCalendar, toJavaCharacter, toJavaCollection, toJavaDate, toJavaDouble, toJavaFloat, toJavaInteger, toJavaList, toJavaLong, toJavaMap, toJavaObject, toJavaObject, toJavaObjectMarshalCost, toJavaObjectNotNull, toJavaShort, toJavaString, toJavaURL, toKey, toLocalRef, toLocalThis, toLocalValue, toLocalValueReadOnly, toLocalVar, toLocalVarDeclAsRef, toLong, toLongMarshalCost, toLongValue, toObject, toRef, toRefValue, toShortMarshalCost, toString, toStringBuilder, toStringBuilder, toStringBuilder, toStringBuilder, toStringMarshalCost, toStringValue, toStringValue, toStringValueMarshalCost, toUnicode, toUnicodeValue, toUnicodeValue, toUnicodeValueMarshalCost, toValue, toVar, unsetArray, unsetField, unsetThisArray, unsetThisField, valuesToArray, varDump, varDumpImpl, varExport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.quercus.env.Callable
call, call, call, call, call, call
 

Constructor Detail

Closure

public Closure(Env env,
               Function fun)
Method Detail

isCallable

public boolean isCallable(Env env,
                          boolean isSyntax)

toCallable

public Callable toCallable(Env env)
Description copied from class: Value
Converts to a callable

Overrides:
toCallable in class Callback

isObject

public boolean isObject()
Description copied from class: Value
Returns true for an object.

Overrides:
isObject in class Value

getType

public java.lang.String getType()
Description copied from class: Value
Returns the type.

Overrides:
getType in class Value

call

public Value call(Env env,
                  Value[] args)
Description copied from class: Callback
Evaluates the callback with variable arguments.

Specified by:
call in interface Callable
Specified by:
call in class Callback
Parameters:
env - the calling environment

getCallbackName

public java.lang.String getCallbackName()
Description copied from class: Callback
Returns the name of the callback.

Specified by:
getCallbackName in interface Callable
Specified by:
getCallbackName in class Callback

isInternal

public boolean isInternal(Env env)
Description copied from class: Callback
Returns true if this callback is implemented internally (i.e. in Java).

Specified by:
isInternal in class Callback

isValid

public boolean isValid(Env env)
Description copied from interface: Callable
Checks for a valid callback.

Specified by:
isValid in interface Callable
Specified by:
isValid in class Callback
Returns:
true if this is an invalid callback reference

callMethod

public Value callMethod(Env env,
                        StringValue methodName,
                        int hash,
                        Value[] args)
Description copied from class: Value
Evaluates a method.

Overrides:
callMethod in class Value

toString

public java.lang.String toString()
Overrides:
toString in class Callback