anvil.core
Class AnyRange

java.lang.Object
  |
  +--anvil.core.Any
        |
        +--anvil.core.AnyRange
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class AnyRange
extends Any

class AnyRange


Field Summary
protected  boolean _ascend
           
static NativeClass _class
           
protected  Any _left
           
protected  Any _right
           
protected  Any _step
           
static java.lang.Object[] newInstance
           
 
Fields inherited from class anvil.core.Any
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
AnyRange(Any left, Any right)
           
AnyRange(Any left, Any right, Any step)
           
 
Method Summary
 ClassType classOf()
          Returns the type of this Any.
 java.lang.Object clone()
          Returns shallow copy from this any.
protected  int compare(Any other)
           
 boolean contains(Any value)
           
 Any copy()
          Returns deep copy from this any.
 boolean equals(java.lang.Object obj)
          Tests for equality.
 Any getAttribute(Context context, java.lang.String attribute)
           
 Any getLeft()
           
 Any getMax()
           
 Any getMin()
           
 Any getReference(Context context, Any index)
           
 Any getRight()
           
 int hashCode()
           
 boolean inRange(Any value, boolean withright)
           
 boolean isRange()
          Checks if this any is range.
 BindingIterator iterator()
           
static Any newInstance(Any a, Any b, Any c)
           
 void serialize(Serializer serializer)
           
 int sizeOf()
          Returns the logical size of this any.
 java.io.Writer toAnvil(java.io.Writer writer)
           
 boolean toBoolean()
          Gets the contained value as boolean.
 Code toCode(Code code)
           
 java.lang.Object toObject()
          Gets the contained value as java.lang.Object.
 AnyRange toRange()
           
 java.lang.String toString()
          Converts contained value into String.
 Any[] toTuple()
          Gets the contained value as Any[].
 int typeOf()
          Returns the type of contained value.
static AnyRange unserialize(Unserializer unserializer)
           
 
Methods inherited from class anvil.core.Any
_clone, _copy, _invoke, _invoke, _invoke, _invoke, _invoke, _invoke, _serialize, _unserialize, _wakeup, add, classNameOf, coerce, compareTo, concat, create, create, create, create, create, create, create, create, create, create, create, create, create, create, decrease, deleteAttribute, deleteReference, divide, execute, execute, execute, execute, execute, execute, getRef, has, increase, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, invoke, isArray, isBinary, isBoolean, isBuffer, isDefined, isDouble, isInstanceOf, isInt, isIterator, isList, isMap, isMutable, isNull, isPattern, isRef, isSequence, isString, isTuple, isUndefined, m_clone, m_compareTo, m_copy, m_each, m_equals, m_hashCode, m_pipe, m_select, m_toBoolean, m_toString, minus, modulo, multiply, not, plus, setAttribute, setRef, setReference, setReference, subtract, toAnvil, toAnyBoolean, toAnyDouble, toAnyInt, toAnyString, toArray, toBinary, toBuffer, toByte, toChar, toDouble, toInt, toList, toLong, toMap, toPattern, type
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

newInstance

public static final java.lang.Object[] newInstance

_class

public static final transient NativeClass _class

_left

protected Any _left

_right

protected Any _right

_step

protected Any _step

_ascend

protected boolean _ascend
Constructor Detail

AnyRange

public AnyRange(Any left,
                Any right)

AnyRange

public AnyRange(Any left,
                Any right,
                Any step)
Method Detail

newInstance

public static final Any newInstance(Any a,
                                    Any b,
                                    Any c)

classOf

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

Overrides:
classOf 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.

sizeOf

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

Overrides:
sizeOf in class Any
Returns:
Logical size

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

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.

getLeft

public Any getLeft()

getRight

public Any getRight()

getMin

public Any getMin()

getMax

public Any getMax()

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.

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.

toRange

public AnyRange toRange()
Overrides:
toRange in class Any

hashCode

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

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.

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

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

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

serialize

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

unserialize

public static final AnyRange unserialize(Unserializer unserializer)
                                  throws UnserializationException
UnserializationException

getReference

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

inRange

public boolean inRange(Any value,
                       boolean withright)

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

iterator

public BindingIterator iterator()
Overrides:
iterator in class Any