com.caucho.quercus.env
Class Callback

java.lang.Object
  extended by com.caucho.quercus.env.Value
      extended by com.caucho.quercus.env.Callback
All Implemented Interfaces:
Callable, java.io.Serializable
Direct Known Subclasses:
AbstractFunction, CallbackClassMethod, CallbackError, CallbackFunction, CallbackObjectMethod, Closure

public abstract class Callback
extends Value
implements Callable

Represents a call to a function.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.quercus.env.Value
L, NULL_ARGS, NULL_VALUE_ARRAY, SCALAR_V
 
Constructor Summary
Callback()
           
 
Method Summary
abstract  Value call(Env env, Value[] args)
          Evaluates the callback with variable arguments.
 Value callArray(Env env, ArrayValue array, Value key, Value a1)
          Evaluates a callback where the first argument is from an array.
 Value callArray(Env env, ArrayValue array, Value key, Value a1, Value a2)
          Evaluates a callback where the first argument is from an array.
 Value callArray(Env env, ArrayValue array, Value key, Value a1, Value a2, Value a3)
          Evaluates a callback where the first argument is from an array.
abstract  java.lang.String getCallbackName()
          Returns the name of the callback.
abstract  boolean isInternal(Env env)
          Returns true if this callback is implemented internally (i.e.
abstract  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.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, 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, getType, 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, isObject, 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

Callback

public Callback()
Method Detail

toCallable

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

Overrides:
toCallable in class Value

callArray

public final Value callArray(Env env,
                             ArrayValue array,
                             Value key,
                             Value a1)
Evaluates a callback where the first argument is from an array. The callback may be modifying that array element. For ArrayModule.

Specified by:
callArray in interface Callable
Parameters:
env -
array - from which a1 came from
key - index of a1 in the array
a1 - need to make a reference to this variable

callArray

public final Value callArray(Env env,
                             ArrayValue array,
                             Value key,
                             Value a1,
                             Value a2)
Evaluates a callback where the first argument is from an array. The callback may be modifying that array element. For ArrayModule.

Specified by:
callArray in interface Callable
Parameters:
env -
array - from which a1 came from
key - index of a1 in the array
a1 - need to make a reference to this variable
a2 - additional argument to pass to the callback

callArray

public final Value callArray(Env env,
                             ArrayValue array,
                             Value key,
                             Value a1,
                             Value a2,
                             Value a3)
Evaluates a callback where the first argument is from an array. The callback may be modifying that array element. For ArrayModule.

Specified by:
callArray in interface Callable
Parameters:
env -
array - from which a1 came from
key - index of a1 in the array
a1 - need to make a reference to this variable
a2 - additional argument to pass to the callback
a3 - additional argument to pass to the callback

call

public abstract Value call(Env env,
                           Value[] args)
Evaluates the callback with variable arguments.

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

isValid

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

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

getCallbackName

public abstract java.lang.String getCallbackName()
Returns the name of the callback.

Specified by:
getCallbackName in interface Callable

isInternal

public abstract boolean isInternal(Env env)
Returns true if this callback is implemented internally (i.e. in Java).


toString

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