railo.runtime.type.util
Class ArraySupport

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

public abstract class ArraySupport
extends AbstractList
implements Array, List, Sizeable, Objects

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 addAll(Collection c)
           
 Object call(PageContext pc, Collection.Key methodName, Object[] args)
          calls a method of the object
 Object callWithNamedValues(PageContext pc, Collection.Key methodName, Struct args)
          call a method of the Object with named arguments
 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 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)
           
 Object get(PageContext pc, Collection.Key key)
          return property or getter of the ContextCollection
 Object get(PageContext pc, Collection.Key key, Object defaultValue)
          return property
 Iterator<Object> getIterator()
           
 int hashCode()
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object element)
           
 Object set(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 Object setEL(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 void sort(String sortType, String sortOrder)
          sort values of a array
 Object[] toArray(Object[] a)
           
 List toList()
           
 String toString()
           
 Iterator<Object> valueIterator()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, size, toArray
 
Methods inherited from class java.lang.Object
getClass, 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, remove, removeEL, set, set, setEL, setEL, size
 
Methods inherited from interface railo.runtime.type.Iteratorable
entryIterator, keyIterator, keysAsStringIterator
 
Methods inherited from interface railo.runtime.dump.Dumpable
toDumpData
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, size, subList, 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
Overrides:
add in class AbstractList

addAll

public final boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class AbstractCollection

remove

public final boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class AbstractCollection

removeAll

public final boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractCollection

retainAll

public final boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List
Overrides:
retainAll in class AbstractCollection

toArray

public final Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection

get

public final Object get(int index)
Specified by:
get in interface List
Specified by:
get in class AbstractList

remove

public final Object remove(int index)
Specified by:
remove in interface List
Overrides:
remove in class AbstractList

set

public final Object set(int index,
                        Object element)
Specified by:
set in interface List
Overrides:
set in class AbstractList

containsKey

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

Returns:
returns if collection has a key with given name

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

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

toString

public String toString()
Overrides:
toString in class AbstractCollection

clone

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

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

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

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

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

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

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

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

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

compareTo

public int compareTo(boolean b)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

public int compareTo(DateTime dt)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

compareTo

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

compareTo

public int compareTo(String str)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException

toList

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

valueIterator

public Iterator<Object> valueIterator()
Specified by:
valueIterator in interface Iteratorable
Returns:
return a Iterator for Values

get

public Object get(PageContext pc,
                  Collection.Key key,
                  Object defaultValue)
Description copied from interface: Objects
return property

Specified by:
get in interface Objects
Parameters:
pc - PageContext
key - Name of the Property
Returns:
return value of the Property

get

public Object get(PageContext pc,
                  Collection.Key key)
           throws PageException
Description copied from interface: Objects
return property or getter of the ContextCollection

Specified by:
get in interface Objects
Parameters:
pc - PageContext
key - Name of the Property
Returns:
return value of the Property
Throws:
PageException

set

public Object set(PageContext pc,
                  Collection.Key propertyName,
                  Object value)
           throws PageException
Description copied from interface: Objects
sets a property (Data Member) value of the object

Specified by:
set in interface Objects
propertyName - property name to set
value - value to insert
Returns:
value set to property
Throws:
PageException

setEL

public Object setEL(PageContext pc,
                    Collection.Key propertyName,
                    Object value)
Description copied from interface: Objects
sets a property (Data Member) value of the object

Specified by:
setEL in interface Objects
propertyName - property name to set
value - value to insert
Returns:
value set to property

call

public Object call(PageContext pc,
                   Collection.Key methodName,
                   Object[] args)
            throws PageException
Description copied from interface: Objects
calls a method of the object

Specified by:
call in interface Objects
methodName - name of the method to call
args - arguments to call method with
Returns:
return value of the method
Throws:
PageException

callWithNamedValues

public Object callWithNamedValues(PageContext pc,
                                  Collection.Key methodName,
                                  Struct args)
                           throws PageException
Description copied from interface: Objects
call a method of the Object with named arguments

Specified by:
callWithNamedValues in interface Objects
Parameters:
pc - PageContext
methodName - name of the method
args - Named Arguments for the method
Returns:
return result of the method
Throws:
PageException

getIterator

public Iterator<Object> getIterator()
Specified by:
getIterator in interface ForEachIteratorable

sort

public void sort(String sortType,
                 String sortOrder)
          throws PageException
Description copied from interface: Array
sort values of a array

Specified by:
sort in interface Array
Parameters:
sortType - search type (text,textnocase,numeric)
sortOrder - (asc,desc)
Throws:
PageException

equals

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

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class AbstractList


Copyright © 2012 Railo