anvil.core
Class AnyRef

java.lang.Object
  |
  +--anvil.core.Any
        |
        +--anvil.core.AnyRef
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable
Direct Known Subclasses:
AnyClassRef, AnyLocalRef, Thunk

public abstract class AnyRef
extends Any


Field Summary
 
Fields inherited from class anvil.core.Any
_class, ARRAY0, DOUBLE_MINUS_ONE, DOUBLE_ONE, DOUBLE_ZERO, EMPTY_STRING, EMPTY_TUPLE, FALSE, INF, IS_ARRAY, IS_BINARY, IS_BOOLEAN, IS_BUFFER, IS_CLASS, IS_DOUBLE, IS_ENUMERATION, IS_INF, IS_INT, IS_LIST, IS_MAP, IS_NEG_INF, IS_NULL, IS_PATTERN, IS_RANGE, IS_STRING, IS_TUPLE, IS_UNDEFINED, MINUS_ONE, NAN, NEG_INF, NULL, ONE, p_compareTo, p_each, p_equals, p_pipe, p_select, THREE, TRUE, TWO, UNDEFINED, ZERO
 
Constructor Summary
AnyRef()
           
 
Method Summary
 Any add(Any b)
          Adds two Any's together.
 ClassType classOf()
          Returns the type of this Any.
 java.lang.Object clone()
          Returns shallow copy from this any.
 Any coerce()
           
protected  int compare(Any other)
           
 boolean contains(Any value)
           
 Any copy()
          Returns deep copy from this any.
 Any decrease()
          Decrease the value by one.
 boolean deleteAttribute(Context context, java.lang.String attribute)
           
 boolean deleteReference(Context context, Any index)
           
 Any divide(Any b)
          Divide two Any's.
 boolean equals(java.lang.Object obj)
          Tests for equality.
 Any execute(Context context)
           
 Any execute(Context context, Any param1)
           
 Any execute(Context context, Any[] parameters)
           
 Any execute(Context context, Any param1, Any param2)
           
 Any execute(Context context, Any param1, Any param2, Any param3)
           
 Any execute(Context context, Any param1, Any param2, Any param3, Any param4)
           
 Any getAttribute(Context context, java.lang.String attribute)
           
abstract  Any getRef()
           
 Any getReference(Context context, Any index)
           
 boolean has(java.lang.String methodName)
           
 int hashCode()
           
 Any increase()
          Increase the value by one.
 Any invoke(Context context, int methodIndex)
           
 Any invoke(Context context, int methodIndex, Any param1)
           
 Any invoke(Context context, int methodIndex, Any[] parameters)
           
 Any invoke(Context context, int methodIndex, Any param1, Any param2)
           
 Any invoke(Context context, int methodIndex, Any param1, Any param2, Any param3)
           
 Any invoke(Context context, int methodIndex, Any param1, Any param2, Any param3, Any param4)
           
 Any invoke(Context context, java.lang.String methodName)
           
 Any invoke(Context context, java.lang.String methodName, Any param1)
           
 Any invoke(Context context, java.lang.String methodName, Any[] parameters)
           
 Any invoke(Context context, java.lang.String methodName, Any param1, Any param2)
           
 Any invoke(Context context, java.lang.String methodName, Any param1, Any param2, Any param3)
           
 Any invoke(Context context, java.lang.String methodName, Any param1, Any param2, Any param3, Any param4)
           
 boolean isArray()
          Checks if this any is array.
 boolean isBinary()
          Checks if this any is binary.
 boolean isBoolean()
          Checks if this any is boolean.
 boolean isBuffer()
          Checks if this any is buffer.
 boolean isDefined()
          Checks if this any is defined.
 boolean isDouble()
          Checks if this any is float.
 boolean isInt()
          Checks if this any is int.
 boolean isIterator()
          Checks if this any is iterator.
 boolean isList()
          Checks if this any is list.
 boolean isMap()
          Checks if this any is map.
 boolean isMutable()
           
 boolean isNull()
          Checks if this any is null.
 boolean isPattern()
          Checks if this any is pattern.
 boolean isRange()
          Checks if this any is range.
 boolean isRef()
           
 boolean isSequence()
           
 boolean isString()
          Checks if this any is string.
 boolean isTuple()
          Checks if this any is tuple.
 boolean isUndefined()
          Checks if this any is undefined.
 BindingIterator iterator()
           
 Any minus()
          Negate the sign.
 Any modulo(Any b)
          Calculate the remainder.
 Any multiply(Any b)
          Multiply two Any's.
 Any plus()
          Remove the sign.
 void serialize(Serializer serializer)
           
 Any setAttribute(Context context, java.lang.String attribute, Any value)
           
abstract  Any setRef(Any value)
           
 Any setReference(Context context, Any value)
           
 Any setReference(Context context, Any index, Any value)
           
 int sizeOf()
          Returns the logical size of this any.
 Any subtract(Any b)
          Substract two Any's.
 java.lang.String toAnvil()
          Converts contained value into value anvil code.
 java.io.Writer toAnvil(java.io.Writer writer)
           
 Any toAnyBoolean()
          Gets the contained value as AnyTrue or AnyFalse
 Any toAnyDouble()
          Gets the contained value as AnyDouble.
 Any toAnyInt()
          Gets the contained value as AnyInt.
 Any toAnyString()
          Converts contained value into AnyString.
 Array toArray()
          Gets the contained vaelue as Array.
 byte[] toBinary()
          Gets the contained value as byte[].
 boolean toBoolean()
          Gets the contained value as boolean.
 java.lang.StringBuffer toBuffer()
           
 byte toByte()
           
 Code toCode(Code code)
           
 double toDouble()
          Gets the contained value as double.
 int toInt()
          Gets the contained value as int.
 Any[] toList()
           
 long toLong()
          Gets the contained value as long.
 AnyMap toMap()
           
 java.lang.Object toObject()
          Gets the contained value as java.lang.Object.
 java.util.regex.Pattern toPattern()
           
 AnyRange toRange()
           
 java.lang.String toString()
          Converts contained value into String.
 Any[] toTuple()
          Gets the contained value as Any[].
 Type type()
           
 int typeOf()
          Returns the type of contained value.
 
Methods inherited from class anvil.core.Any
_clone, _copy, _invoke, _invoke, _invoke, _invoke, _invoke, _invoke, _serialize, _unserialize, _wakeup, classNameOf, compareTo, concat, create, create, create, create, create, create, create, create, create, create, create, create, create, create, isInstanceOf, m_clone, m_compareTo, m_copy, m_each, m_equals, m_hashCode, m_pipe, m_select, m_toBoolean, m_toString, not, toChar
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnyRef

public AnyRef()
Method Detail

isRef

public boolean isRef()
Overrides:
isRef in class Any

setRef

public abstract Any setRef(Any value)
Overrides:
setRef in class Any

getRef

public abstract Any getRef()
Overrides:
getRef in class Any

clone

public java.lang.Object clone()
Description copied from class: Any
Returns shallow copy from this any.

Overrides:
clone in class Any
Returns:
Shallow copy

copy

public Any copy()
Description copied from class: Any
Returns deep copy from this any.

Overrides:
copy in class Any

sizeOf

public int sizeOf()
Description copied from class: Any
Returns the logical size of this any.

Overrides:
sizeOf in class Any
Returns:
Logical size

classOf

public ClassType classOf()
Description copied from class: Any
Returns the type of this Any.

Overrides:
classOf in class Any

type

public Type type()
Overrides:
type in class Any

typeOf

public int typeOf()
Description copied from class: Any
Returns the type of contained value.

Overrides:
typeOf in class Any
Returns:
Type of this any as int.

isDefined

public boolean isDefined()
Description copied from class: Any
Checks if this any is defined. Only undefined returns false for this method.

Overrides:
isDefined in class Any
Returns:
true if this is other than undefined

isUndefined

public boolean isUndefined()
Description copied from class: Any
Checks if this any is undefined.

Overrides:
isUndefined in class Any
Returns:
true if this is undefined

isNull

public boolean isNull()
Description copied from class: Any
Checks if this any is null.

Overrides:
isNull in class Any
Returns:
true if this is null

isBoolean

public boolean isBoolean()
Description copied from class: Any
Checks if this any is boolean.

Overrides:
isBoolean in class Any
Returns:
true if this is boolean

isInt

public boolean isInt()
Description copied from class: Any
Checks if this any is int.

Overrides:
isInt in class Any
Returns:
true if this is int

isDouble

public boolean isDouble()
Description copied from class: Any
Checks if this any is float. In script the float is used, but the implementation uses double.

Overrides:
isDouble in class Any
Returns:
true if this is float

isMutable

public boolean isMutable()
Overrides:
isMutable in class Any

isSequence

public boolean isSequence()
Overrides:
isSequence in class Any

isString

public boolean isString()
Description copied from class: Any
Checks if this any is string.

Overrides:
isString in class Any
Returns:
true if this is string

isBinary

public boolean isBinary()
Description copied from class: Any
Checks if this any is binary.

Overrides:
isBinary in class Any
Returns:
true if this is binary

isTuple

public boolean isTuple()
Description copied from class: Any
Checks if this any is tuple.

Overrides:
isTuple in class Any
Returns:
true if this is tuple

isList

public boolean isList()
Description copied from class: Any
Checks if this any is list.

Overrides:
isList in class Any
Returns:
true if this is list

isArray

public boolean isArray()
Description copied from class: Any
Checks if this any is array.

Overrides:
isArray in class Any
Returns:
true if this is array

isPattern

public boolean isPattern()
Description copied from class: Any
Checks if this any is pattern.

Overrides:
isPattern in class Any
Returns:
true if this is pattern

isRange

public boolean isRange()
Description copied from class: Any
Checks if this any is range.

Overrides:
isRange in class Any
Returns:
true if this is range

isMap

public boolean isMap()
Description copied from class: Any
Checks if this any is map.

Overrides:
isMap in class Any
Returns:
true if this is map

isBuffer

public boolean isBuffer()
Description copied from class: Any
Checks if this any is buffer.

Overrides:
isBuffer in class Any
Returns:
true if this is buffer

isIterator

public boolean isIterator()
Description copied from class: Any
Checks if this any is iterator.

Overrides:
isIterator in class Any
Returns:
true if this is iterator

toObject

public java.lang.Object toObject()
Description copied from class: Any
Gets the contained value as java.lang.Object.

Overrides:
toObject in class Any
Returns:
Value as Object.

toInt

public int toInt()
Description copied from class: Any
Gets the contained value as int.

Overrides:
toInt in class Any
Returns:
Value as int or zero if it can't be transformed.

toByte

public byte toByte()
Overrides:
toByte in class Any

toLong

public long toLong()
Description copied from class: Any
Gets the contained value as long.

Overrides:
toLong in class Any
Returns:
Value as long or zero if it can't be transformed.

toDouble

public double toDouble()
Description copied from class: Any
Gets the contained value as double.

Overrides:
toDouble in class Any
Returns:
Value as double or 0.0 if it can't be transformed.

toBoolean

public boolean toBoolean()
Description copied from class: Any
Gets the contained value as boolean. Integer is considered true if it is different from 0. Double is considered true if it is different from 0.0. String is considered true if it contains "true", "on", "yes" or "1".

Overrides:
toBoolean in class Any
Returns:
Value as boolean or false if it can't be transformed.

toString

public java.lang.String toString()
Description copied from class: Any
Converts contained value into String.

Overrides:
toString in class Any
Returns:
Value as String.

toBuffer

public java.lang.StringBuffer toBuffer()
Overrides:
toBuffer in class Any

toAnvil

public java.lang.String toAnvil()
Description copied from class: Any
Converts contained value into value anvil code.

Overrides:
toAnvil in class Any
Returns:
Value as anvil code.

toAnvil

public java.io.Writer toAnvil(java.io.Writer writer)
                       throws java.io.IOException
Overrides:
toAnvil in class Any
java.io.IOException

toCode

public Code toCode(Code code)
Overrides:
toCode in class Any

toArray

public Array toArray()
Description copied from class: Any
Gets the contained vaelue as Array.

Overrides:
toArray in class Any
Returns:
Value as Array or null if this instance doesn't contain Array.

toBinary

public byte[] toBinary()
Description copied from class: Any
Gets the contained value as byte[].

Overrides:
toBinary in class Any
Returns:
Value as byte[] or null if this instance isn't AnyBinary.

toTuple

public Any[] toTuple()
Description copied from class: Any
Gets the contained value as Any[].

Overrides:
toTuple in class Any
Returns:
Value as Any[] or null if this instance isn't AnyTuple.

toList

public Any[] toList()
Overrides:
toList in class Any

toPattern

public java.util.regex.Pattern toPattern()
Overrides:
toPattern in class Any

toMap

public AnyMap toMap()
Overrides:
toMap in class Any

toRange

public AnyRange toRange()
Overrides:
toRange in class Any

toAnyBoolean

public Any toAnyBoolean()
Description copied from class: Any
Gets the contained value as AnyTrue or AnyFalse

Overrides:
toAnyBoolean in class Any
Returns:
Value as AnyBoolean.

toAnyInt

public Any toAnyInt()
Description copied from class: Any
Gets the contained value as AnyInt.

Overrides:
toAnyInt in class Any
Returns:
Value as AnyInt.

toAnyDouble

public Any toAnyDouble()
Description copied from class: Any
Gets the contained value as AnyDouble.

Overrides:
toAnyDouble in class Any
Returns:
Value as AnyDouble.

toAnyString

public Any toAnyString()
Description copied from class: Any
Converts contained value into AnyString.

Overrides:
toAnyString in class Any
Returns:
Value as AnyString.

add

public Any add(Any b)
Description copied from class: Any
Adds two Any's together.

Overrides:
add in class Any
Returns:
Calculated value

subtract

public Any subtract(Any b)
Description copied from class: Any
Substract two Any's.

Overrides:
subtract in class Any
Returns:
Calculated value

multiply

public Any multiply(Any b)
Description copied from class: Any
Multiply two Any's. Returned type will be the same as of this instance. Will only work with integer and double.

Overrides:
multiply in class Any
Returns:
Calculated value

divide

public Any divide(Any b)
Description copied from class: Any
Divide two Any's.

Overrides:
divide in class Any
Returns:
Calculated value

modulo

public Any modulo(Any b)
Description copied from class: Any
Calculate the remainder.

Overrides:
modulo in class Any
Returns:
Calculated value

increase

public Any increase()
Description copied from class: Any
Increase the value by one.

Overrides:
increase in class Any
Returns:
Increased value

decrease

public Any decrease()
Description copied from class: Any
Decrease the value by one.

Overrides:
decrease in class Any
Returns:
Decreased value

minus

public Any minus()
Description copied from class: Any
Negate the sign.

Overrides:
minus in class Any
Returns:
Negated value

plus

public Any plus()
Description copied from class: Any
Remove the sign.

Overrides:
plus in class Any
Returns:
Value, with sign removed

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Any
Tests for equality.

Overrides:
equals in class Any
Returns:
true if equal, false otherwise.

compare

protected int compare(Any other)
Overrides:
compare in class Any

coerce

public Any coerce()
Overrides:
coerce in class Any

serialize

public void serialize(Serializer serializer)
               throws java.io.IOException
Overrides:
serialize in class Any
java.io.IOException

contains

public boolean contains(Any value)
Overrides:
contains in class Any

getAttribute

public Any getAttribute(Context context,
                        java.lang.String attribute)
Overrides:
getAttribute in class Any

setAttribute

public Any setAttribute(Context context,
                        java.lang.String attribute,
                        Any value)
Overrides:
setAttribute in class Any

deleteAttribute

public boolean deleteAttribute(Context context,
                               java.lang.String attribute)
Overrides:
deleteAttribute in class Any

getReference

public Any getReference(Context context,
                        Any index)
Overrides:
getReference in class Any

setReference

public Any setReference(Context context,
                        Any index,
                        Any value)
Overrides:
setReference in class Any

setReference

public Any setReference(Context context,
                        Any value)
Overrides:
setReference in class Any

deleteReference

public boolean deleteReference(Context context,
                               Any index)
Overrides:
deleteReference in class Any

iterator

public BindingIterator iterator()
Overrides:
iterator in class Any

execute

public Any execute(Context context,
                   Any[] parameters)
Overrides:
execute in class Any

execute

public Any execute(Context context)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1,
                   Any param2)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1,
                   Any param2,
                   Any param3)
Overrides:
execute in class Any

execute

public Any execute(Context context,
                   Any param1,
                   Any param2,
                   Any param3,
                   Any param4)
Overrides:
execute in class Any

has

public boolean has(java.lang.String methodName)
Overrides:
has in class Any

invoke

public Any invoke(Context context,
                  java.lang.String methodName,
                  Any[] parameters)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  int methodIndex,
                  Any[] parameters)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  int methodIndex)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  int methodIndex,
                  Any param1)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  int methodIndex,
                  Any param1,
                  Any param2)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  int methodIndex,
                  Any param1,
                  Any param2,
                  Any param3)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  int methodIndex,
                  Any param1,
                  Any param2,
                  Any param3,
                  Any param4)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  java.lang.String methodName)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  java.lang.String methodName,
                  Any param1)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  java.lang.String methodName,
                  Any param1,
                  Any param2)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  java.lang.String methodName,
                  Any param1,
                  Any param2,
                  Any param3)
Overrides:
invoke in class Any

invoke

public Any invoke(Context context,
                  java.lang.String methodName,
                  Any param1,
                  Any param2,
                  Any param3,
                  Any param4)
Overrides:
invoke in class Any