railo.runtime.type.wrap
Class ListAsArray

java.lang.Object
  extended by railo.runtime.type.wrap.ListAsArray
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, Dumpable, Castable, Array, ForEachIteratorable, Iteratorable, Objects, Sizeable

public class ListAsArray
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
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 Object append(Object o)
          append a new value to the end of the array
 Object appendEL(Object o)
           
 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
 void clear()
          clears the collection
 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 index)
          contains this key
 boolean containsKey(String key)
          contains this key
 Collection duplicate(boolean deepCopy)
           
 Iterator<Map.Entry<Collection.Key,Object>> entryIterator()
           
 Object get(Collection.Key key)
          return a value from the collection
 Object get(Collection.Key key, Object defaultValue)
          return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null
 Object get(int index)
           
 Object get(int key, Object defaultValue)
          return object a given position, key can only be a integer from 1 to array len
 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
 Object get(String key)
          return a value from the collection
 Object get(String key, Object defaultValue)
          return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null
 int getDimension()
          return dimension of the array
 Object getE(int key)
          return object a given position, key can only be a integer from 1 to array len
 Iterator<Object> getIterator()
           
 int indexOf(Object o)
           
 boolean insert(int key, Object value)
          insert a value add defined position
 int[] intKeys()
           
 boolean isEmpty()
           
 Iterator iterator()
           
 Iterator<Collection.Key> keyIterator()
           
 Collection.Key[] keys()
           
 Iterator<String> keysAsStringIterator()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object prepend(Object o)
          add a new value to the begin of the array
 Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 Object removeE(int key)
          removes a value ad defined key
 Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 Object removeEL(int key)
          removes a value ad defined key
 void resize(int to)
          resize array to defined size
 boolean retainAll(Collection c)
           
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 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 set(String key, Object value)
          sets a value to the collection
 Object setE(int key, Object value)
          set value at defined position
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 Object setEL(int key, Object value)
          set value at defined position, on error return null
 Object setEL(PageContext pc, Collection.Key propertyName, Object value)
          sets a property (Data Member) value of the object
 Object setEL(String key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 int size()
           
 long sizeOf()
          return the size of the object
 void sort(Comparator comp)
           
 void sort(String sortType, String sortOrder)
          sort values of a array
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
static Array toArray(List list)
           
 Object[] toArray(Object[] a)
           
 ArrayList toArrayList()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 List toList()
           
 String toString()
           
 Iterator valueIterator()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Method Detail

toArray

public static Array toArray(List list)

append

public Object append(Object o)
              throws PageException
Description copied from interface: Array
append a new value to the end of the array

Specified by:
append in interface Array
Parameters:
o - value to insert
Returns:
inserted value
Throws:
PageException

appendEL

public Object appendEL(Object o)
Specified by:
appendEL in interface Array

containsKey

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

Specified by:
containsKey in interface Array
Returns:
returns if collection has a key with given name

get

public Object get(int key,
                  Object defaultValue)
Description copied from interface: Array
return object a given position, key can only be a integer from 1 to array len

Specified by:
get in interface Array
Parameters:
key - key as integer
Returns:
value at key position

getE

public Object getE(int key)
            throws PageException
Description copied from interface: Array
return object a given position, key can only be a integer from 1 to array len

Specified by:
getE in interface Array
Parameters:
key - key as integer
Returns:
value at key position
Throws:
PageException

getDimension

public int getDimension()
Description copied from interface: Array
return dimension of the array

Specified by:
getDimension in interface Array
Returns:
dimension of the array

insert

public boolean insert(int key,
                      Object value)
               throws PageException
Description copied from interface: Array
insert a value add defined position

Specified by:
insert in interface Array
Parameters:
key - position to insert
value - value to insert
Returns:
has done or not
Throws:
PageException

intKeys

public int[] intKeys()
Specified by:
intKeys in interface Array
Returns:
return all array keys as int

prepend

public Object prepend(Object o)
               throws PageException
Description copied from interface: Array
add a new value to the begin of the array

Specified by:
prepend in interface Array
Parameters:
o - value to insert
Returns:
inserted value
Throws:
PageException

removeE

public Object removeE(int key)
               throws PageException
Description copied from interface: Array
removes a value ad defined key

Specified by:
removeE in interface Array
Parameters:
key - key to remove
Returns:
retuns if value is removed or not
Throws:
PageException

removeEL

public Object removeEL(int key)
Description copied from interface: Array
removes a value ad defined key

Specified by:
removeEL in interface Array
Parameters:
key - key to remove
Returns:
retuns if value is removed or not

resize

public void resize(int to)
            throws PageException
Description copied from interface: Array
resize array to defined size

Specified by:
resize in interface Array
Parameters:
to - new minimum size of the array
Throws:
PageException

setE

public Object setE(int key,
                   Object value)
            throws PageException
Description copied from interface: Array
set value at defined position

Specified by:
setE in interface Array
Returns:
defined value
Throws:
PageException

setEL

public Object setEL(int key,
                    Object value)
Description copied from interface: Array
set value at defined position, on error return null

Specified by:
setEL in interface Array
Parameters:
key - key of the new value
value - value to set
Returns:
setted value

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

sort

public void sort(Comparator comp)
          throws PageException
Specified by:
sort in interface Array
Throws:
PageException

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Specified by:
toArray in interface Array
Returns:
return arra as native (Java) Object Array

toArrayList

public ArrayList toArrayList()

clear

public void clear()
Description copied from interface: Collection
clears the collection

Specified by:
clear in interface Collection
Specified by:
clear in interface List

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

duplicate

public Collection duplicate(boolean deepCopy)

get

public Object get(String key)
           throws PageException
Description copied from interface: Collection
return a value from the collection

Parameters:
key - key of the value to get
Returns:
value on key position
Throws:
PageException

get

public Object get(Collection.Key key)
           throws PageException
Description copied from interface: Collection
return a value from the collection

Parameters:
key - key of the value to get must be lower case
Returns:
value on key position
Throws:
PageException

get

public Object get(String key,
                  Object defaultValue)
Description copied from interface: Collection
return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null

Parameters:
key - key of the value to get
Returns:
value on key position or null

get

public Object get(Collection.Key key,
                  Object defaultValue)
Description copied from interface: Collection
return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null

Parameters:
key - key of the value to get
Returns:
value on key position or null

keys

public Collection.Key[] keys()
Returns:
returns a string array of all keys in the collection

remove

public Object remove(Collection.Key key)
              throws PageException
Description copied from interface: Collection
removes value from collection and return it when it exists, otherwise throws a exception

Parameters:
key - key of the collection
Returns:
removed Object
Throws:
PageException

removeEL

public Object removeEL(Collection.Key key)
Description copied from interface: Collection
removes value from collection and return it when it exists, otherwise returns null

Parameters:
key - key of the collection
Returns:
removed Object

set

public Object set(String key,
                  Object value)
           throws PageException
Description copied from interface: Collection
sets a value to the collection

Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException

set

public Object set(Collection.Key key,
                  Object value)
           throws PageException
Description copied from interface: Collection
sets a value to the collection

Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException

setEL

public Object setEL(String key,
                    Object value)
Description copied from interface: Collection
sets a value to the collection, if key doesn't exist, dont throw a exception, returns null

Parameters:
key - key of the value to get
value - value to set
Returns:
value on key position or null

setEL

public Object setEL(Collection.Key key,
                    Object value)
Description copied from interface: Collection
sets a value to the collection, if key doesn't exist, dont throw a exception, returns null

Parameters:
key - key of the value to get
value - value to set
Returns:
value on key position or null

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Returns:
the size of the collection

toDumpData

public DumpData toDumpData(PageContext pageContext,
                           int maxlevel,
                           DumpProperties dp)
Description copied from interface: Dumpable
method to print out information to a object as HTML

Specified by:
toDumpData in interface Dumpable
Returns:
HTML print out

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List

keyIterator

public Iterator<Collection.Key> keyIterator()
Specified by:
keyIterator in interface Iteratorable
Returns:
return a Iterator for Keys as Collection.Keys

keysAsStringIterator

public Iterator<String> keysAsStringIterator()
Specified by:
keysAsStringIterator in interface Iteratorable
Returns:
return a Iterator for Keys as String

entryIterator

public Iterator<Map.Entry<Collection.Key,Object>> entryIterator()
Specified by:
entryIterator in interface Iteratorable

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

toString

public String toString()
Overrides:
toString in class Object

clone

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

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface List

add

public void add(int index,
                Object element)
Specified by:
add in interface List

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List

get

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

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List

remove

public Object remove(int index)
Specified by:
remove in interface List

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List

toList

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

valueIterator

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

sizeOf

public long sizeOf()
Description copied from interface: Sizeable
return the size of the object

Specified by:
sizeOf in interface Sizeable
Returns:
size of the object

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


Copyright © 2012 Railo