railo.runtime.type.util
Class ArraySupport

java.lang.Object
  extended by railo.runtime.type.util.ArraySupport
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, Dumpable, Castable, Array, Iteratorable, Sizeable
Direct Known Subclasses:
ArrayImpl, ArrayImplNS, XMLMultiElementArray, XMLNodeList

public abstract class ArraySupport
extends Object
implements Array, List, Sizeable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface railo.runtime.type.Collection
Collection.Key
 
Field Summary
static short TYPE_BOOLEAN
           
static short TYPE_BYTE
           
static short TYPE_CHARACTER
           
static short TYPE_DOUBLE
           
static short TYPE_FLOAT
           
static short TYPE_INT
           
static short TYPE_LONG
           
static short TYPE_OBJECT
           
static short TYPE_SHORT
           
static short TYPE_STRING
           
 
Constructor Summary
ArraySupport()
           
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
          adds a value and return this array
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 Boolean castToBoolean(Boolean defaultValue)
          cast the castable value to a boolean value
 boolean castToBooleanValue()
          cast the castable value to a boolean value
 DateTime castToDateTime()
          cast the castable value to a date time object
 DateTime castToDateTime(DateTime defaultValue)
          cast the castable value to a date time object
 double castToDoubleValue()
          cast the castable value to a double value
 double castToDoubleValue(double defaultValue)
          cast the castable value to a double value
 String castToString()
          cast the castable value to a string, other than the Method toString, this Method can throw a Exception
 String castToString(String defaultValue)
          cast the castable value to a string, return the default value, when the method is not castable
 Object clone()
           
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(String str)
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean containsKey(Collection.Key key)
          contains this key
 boolean containsKey(int key)
          contains this key
 boolean containsKey(String key)
          contains this key
 boolean equals(Object obj)
           
 Object get(int index)
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object element)
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray(Object[] a)
           
 List toList()
           
 String toString()
           
 Iterator valueIterator()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.Array
append, appendEL, get, getDimension, getE, insert, intKeys, prepend, removeE, removeEL, resize, setE, setEL, sort, toArray
 
Methods inherited from interface railo.runtime.type.Collection
clear, duplicate, get, get, get, get, keys, keysAsString, remove, removeEL, set, set, setEL, setEL, size
 
Methods inherited from interface railo.runtime.dump.Dumpable
toDumpData
 
Methods inherited from interface railo.runtime.type.Iteratorable
iterator, keyIterator
 
Methods inherited from interface java.util.List
clear, hashCode, iterator, size, toArray
 
Methods inherited from interface railo.runtime.type.Sizeable
sizeOf
 

Field Detail

TYPE_OBJECT

public static final short TYPE_OBJECT
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final short TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_BYTE

public static final short TYPE_BYTE
See Also:
Constant Field Values

TYPE_SHORT

public static final short TYPE_SHORT
See Also:
Constant Field Values

TYPE_INT

public static final short TYPE_INT
See Also:
Constant Field Values

TYPE_LONG

public static final short TYPE_LONG
See Also:
Constant Field Values

TYPE_FLOAT

public static final short TYPE_FLOAT
See Also:
Constant Field Values

TYPE_DOUBLE

public static final short TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_CHARACTER

public static final short TYPE_CHARACTER
See Also:
Constant Field Values

TYPE_STRING

public static final short TYPE_STRING
See Also:
Constant Field Values
Constructor Detail

ArraySupport

public ArraySupport()
Method Detail

add

public final void add(int index,
                      Object element)
Specified by:
add in interface List
See Also:
java.util.List#add(int, E)

addAll

public final boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
See Also:
List.addAll(java.util.Collection)

addAll

public final boolean addAll(int index,
                            Collection c)
Specified by:
addAll in interface List
See Also:
List.addAll(int, java.util.Collection)

add

public boolean add(Object o)
adds a value and return this array

Specified by:
add in interface Collection
Specified by:
add in interface List
Parameters:
o -
Returns:
this Array

contains

public final boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
See Also:
List.contains(java.lang.Object)

containsAll

public final boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List
See Also:
List.containsAll(java.util.Collection)

indexOf

public final int indexOf(Object o)
Specified by:
indexOf in interface List
See Also:
List.indexOf(java.lang.Object)

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
See Also:
List.isEmpty()

lastIndexOf

public final int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List
See Also:
List.lastIndexOf(java.lang.Object)

listIterator

public final ListIterator listIterator()
Specified by:
listIterator in interface List
See Also:
List.listIterator()

listIterator

public final ListIterator listIterator(int index)
Specified by:
listIterator in interface List
See Also:
List.listIterator(int)

remove

public final boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
See Also:
List.remove(java.lang.Object)

removeAll

public final boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
See Also:
List.removeAll(java.util.Collection)

retainAll

public final boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List
See Also:
List.retainAll(java.util.Collection)

subList

public final List subList(int fromIndex,
                          int toIndex)
Specified by:
subList in interface List
See Also:
List.subList(int, int)

toArray

public final Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
See Also:
java.util.List#toArray(T[])

get

public final Object get(int index)
Specified by:
get in interface List
See Also:
List.get(int)

remove

public final Object remove(int index)
Specified by:
remove in interface List
See Also:
List.remove(int)

set

public final Object set(int index,
                        Object element)
Specified by:
set in interface List
See Also:
List.set(int, java.lang.Object)

containsKey

public boolean containsKey(String key)
Description copied from interface: Collection
contains this key

Returns:
returns if collection has a key with given name
See Also:
Collection.containsKey(java.lang.String)

containsKey

public boolean containsKey(Collection.Key key)
Description copied from interface: Collection
contains this key

Returns:
returns if collection has a key with given name
See Also:
railo.runtime.type.Collection#_contains(java.lang.String)

containsKey

public boolean containsKey(int key)
Description copied from interface: Array
contains this key

Specified by:
containsKey in interface Array
Returns:
returns if collection has a key with given name
See Also:
Array.containsKey(int)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

clone

public Object clone()
Overrides:
clone in class Object
Returns:
this object cloned
See Also:
Object.clone()

castToString

public String castToString()
                    throws PageException
Description copied from interface: Castable
cast the castable value to a string, other than the Method toString, this Method can throw a Exception

Specified by:
castToString in interface Castable
Returns:
String representation of the Object
Throws:
PageException
See Also:
Castable.castToString()

castToString

public String castToString(String defaultValue)
Description copied from interface: Castable
cast the castable value to a string, return the default value, when the method is not castable

Specified by:
castToString in interface Castable
Returns:
String representation of the Object
See Also:
Castable.castToString(java.lang.String)

castToBooleanValue

public boolean castToBooleanValue()
                           throws PageException
Description copied from interface: Castable
cast the castable value to a boolean value

Specified by:
castToBooleanValue in interface Castable
Returns:
boolean Value representation of the Object
Throws:
PageException
See Also:
Castable.castToBooleanValue()

castToBoolean

public Boolean castToBoolean(Boolean defaultValue)
Description copied from interface: Castable
cast the castable value to a boolean value

Specified by:
castToBoolean in interface Castable
Returns:
boolean Value representation of the Object
See Also:
Castable.castToBoolean(java.lang.Boolean)

castToDoubleValue

public double castToDoubleValue()
                         throws PageException
Description copied from interface: Castable
cast the castable value to a double value

Specified by:
castToDoubleValue in interface Castable
Returns:
double Value representation of the Object
Throws:
PageException
See Also:
Castable.castToDoubleValue()

castToDoubleValue

public double castToDoubleValue(double defaultValue)
Description copied from interface: Castable
cast the castable value to a double value

Specified by:
castToDoubleValue in interface Castable
Returns:
double Value representation of the Object
See Also:
Castable.castToDoubleValue(double)

castToDateTime

public DateTime castToDateTime()
                        throws PageException
Description copied from interface: Castable
cast the castable value to a date time object

Specified by:
castToDateTime in interface Castable
Returns:
date time representation of the Object
Throws:
PageException
See Also:
Castable.castToDateTime()

castToDateTime

public DateTime castToDateTime(DateTime defaultValue)
Description copied from interface: Castable
cast the castable value to a date time object

Specified by:
castToDateTime in interface Castable
Parameters:
defaultValue - returned when it is not possible to cast to a dateTime object
Returns:
date time representation of the Object
See Also:
Castable.castToDateTime(railo.runtime.type.dt.DateTime)

compareTo

public int compareTo(boolean b)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
railo.runtime.op.Castable#compare(boolean)

compareTo

public int compareTo(DateTime dt)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
Castable.compareTo(railo.runtime.type.dt.DateTime)

compareTo

public int compareTo(double d)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
Castable.compareTo(double)

compareTo

public int compareTo(String str)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
Castable.compareTo(java.lang.String)

toList

public List toList()
Specified by:
toList in interface Array
Returns:
return array as ArrayList
See Also:
Array.toList()

valueIterator

public Iterator valueIterator()
Specified by:
valueIterator in interface Iteratorable
Returns:
return a Iterator for Values
See Also:
Iteratorable.valueIterator()

equals

public boolean equals(Object obj)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Object


Copyright © 2012 Railo