railo.runtime.type
Class ArrayImpl

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

public class ArrayImpl
extends ArraySupport
implements Sizeable

cold fusion array object

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface railo.runtime.type.Collection
Collection.Key
 
Field Summary
 
Fields inherited from class railo.runtime.type.util.ArraySupport
TYPE_BOOLEAN, TYPE_BYTE, TYPE_CHARACTER, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_OBJECT, TYPE_SHORT, TYPE_STRING
 
Constructor Summary
ArrayImpl()
          constructor with default dimesnion (1)
ArrayImpl(int dimension)
          constructor with definiton of the dimension
ArrayImpl(Object[] objects)
          constructor with to data to fill
 
Method Summary
 String _append(String str)
          append a new value to the end of the array
 Object append(Object o)
          append a new value to the end of the array
 Object appendEL(Object o)
          append a new value to the end of the array
 void clear()
          clears the collection
 Collection duplicate(boolean deepCopy)
           
 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 key, Object defaultValue)
          return object a given position, key can only be a integer from 1 to array len
 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
 boolean insert(int key, Object value)
          insert a value add defined position
 int[] intKeys()
           
 Iterator iterator()
           
 Iterator keyIterator()
           
 Collection.Key[] keys()
           
 String[] keysAsString()
           
 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 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
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 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(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
 Object[] toArray()
           
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp)
          method to print out information to a object as HTML
 String toPlain()
          return code print of the array as plain text
 
Methods inherited from class railo.runtime.type.util.ArraySupport
add, add, addAll, addAll, castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, clone, compareTo, compareTo, compareTo, compareTo, contains, containsAll, containsKey, containsKey, containsKey, equals, get, indexOf, isEmpty, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toList, toString, valueIterator
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
hashCode
 

Constructor Detail

ArrayImpl

public ArrayImpl(int dimension)
          throws ExpressionException
constructor with definiton of the dimension

Parameters:
dimension - dimension goes from one to 3
Throws:
ExpressionException

ArrayImpl

public ArrayImpl()
constructor with default dimesnion (1)


ArrayImpl

public ArrayImpl(Object[] objects)
constructor with to data to fill

Parameters:
objects - Objects array data to fill
Method Detail

getDimension

public int getDimension()
return dimension of the array

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

get

public Object get(String key)
           throws ExpressionException
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:
ExpressionException
See Also:
Collection.get(java.lang.String)

get

public Object get(Collection.Key key)
           throws ExpressionException
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:
ExpressionException
See Also:
Collection.get(railo.runtime.type.Collection.Key)

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
See Also:
Collection.get(java.lang.String, java.lang.Object)

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
See Also:
Collection.get(railo.runtime.type.Collection.Key, java.lang.Object)

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
See Also:
Array.get(int, java.lang.Object)

getE

public Object getE(int key)
            throws ExpressionException
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:
ExpressionException
See Also:
Array.getE(int)

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
See Also:
Collection.setEL(java.lang.String, java.lang.Object)

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
See Also:
railo.runtime.type.Collection#_setEL(java.lang.String, java.lang.Object)

set

public Object set(String key,
                  Object value)
           throws ExpressionException
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:
ExpressionException
See Also:
Collection.set(java.lang.String, java.lang.Object)

set

public Object set(Collection.Key key,
                  Object value)
           throws ExpressionException
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:
ExpressionException
See Also:
railo.runtime.type.Collection#_set(java.lang.String, java.lang.Object)

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
See Also:
Array.setEL(int, java.lang.Object)

setE

public Object setE(int key,
                   Object value)
            throws ExpressionException
set value at defined position

Specified by:
setE in interface Array
Parameters:
key -
value -
Returns:
defined value
Throws:
ExpressionException

size

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

keys

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

keysAsString

public String[] keysAsString()
Returns:
returns a string array of all keys in the collection
See Also:
Collection.keysAsString()

intKeys

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

remove

public Object remove(Collection.Key key)
              throws ExpressionException
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:
ExpressionException
See Also:
Collection.remove(railo.runtime.type.Collection.Key)

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

removeE

public Object removeE(int key)
               throws ExpressionException
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:
ExpressionException
See Also:
Array.removeE(int)

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
See Also:
Array.removeEL(int)

clear

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

Specified by:
clear in interface Collection
Specified by:
clear in interface List
See Also:
Collection.clear()

insert

public boolean insert(int key,
                      Object value)
               throws ExpressionException
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:
ExpressionException
See Also:
Array.insert(int, java.lang.Object)

append

public Object append(Object o)
              throws ExpressionException
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:
ExpressionException
See Also:
Array.append(java.lang.Object)

appendEL

public Object appendEL(Object o)
append a new value to the end of the array

Specified by:
appendEL in interface Array
Parameters:
o - value to insert
Returns:
inserted value

_append

public String _append(String str)
append a new value to the end of the array

Parameters:
str - value to insert
Returns:
inserted value

prepend

public Object prepend(Object o)
               throws ExpressionException
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:
ExpressionException

resize

public void resize(int to)
resize array to defined size

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

sort

public void sort(String sortType,
                 String sortOrder)
          throws PageException
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
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

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
See Also:
railo.runtime.dump.Dumpable#toDumpData(railo.runtime.PageContext, int)

toPlain

public String toPlain()
return code print of the array as plain text

Returns:
content as string

duplicate

public Collection duplicate(boolean deepCopy)
See Also:
Collection.duplicate(boolean)

keyIterator

public Iterator keyIterator()
Specified by:
keyIterator in interface Iteratorable
Returns:
return a Iterator for Keys as String
See Also:
Iteratorable.keyIterator()

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List
Specified by:
iterator in interface Iteratorable
Returns:
return a Iterator for keys
See Also:
Iteratorable.iterator()

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
See Also:
railo.runtime.engine.Sizeable#sizeOf()


Copyright © 2012 Railo