railo.runtime.type
Interface Collection

All Superinterfaces:
Castable, java.lang.Cloneable, Dumpable, Iteratorable, java.io.Serializable
All Known Subinterfaces:
Application, Argument, Array, Caller, CGI, Client, Cluster, Component, Cookie, Form, Local, Query, QueryColumn, QueryTable, Request, Scope, Server, Session, Struct, Threads, Undefined, URL, URLForm, Variables

public interface Collection
extends Dumpable, Iteratorable, java.lang.Cloneable, java.io.Serializable, Castable

interface collection, used for all collection types of railo (array, struct, query)


Nested Class Summary
static interface Collection.Key
           
 
Method Summary
 void clear()
          clears the collection
 java.lang.Object clone()
           
 boolean containsKey(Collection.Key key)
          contains this key
 boolean containsKey(java.lang.String key)
          Deprecated. use instead containsKey(railo.runtime.type.Collection.Key)
 Collection duplicate(boolean deepCopy)
           
 java.lang.Object get(Collection.Key key)
          return a value from the collection
 java.lang.Object get(Collection.Key key, java.lang.Object defaultValue)
          return a value from the collection, if key doesn't exist, dont throw a exception, reeturns null
 java.lang.Object get(java.lang.String key)
          Deprecated. use instead get(railo.runtime.type.Collection.Key)
 java.lang.Object get(java.lang.String key, java.lang.Object defaultValue)
          Deprecated. use instead get(railo.runtime.type.Collection.Key, Object)
 Collection.Key[] keys()
           
 java.lang.String[] keysAsString()
          Deprecated. use instead keys()
 java.lang.Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 java.lang.Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 java.lang.Object set(Collection.Key key, java.lang.Object value)
          sets a value to the collection
 java.lang.Object set(java.lang.String key, java.lang.Object value)
          Deprecated. use instead set(railo.runtime.type.Collection.Key, Object)
 java.lang.Object setEL(Collection.Key key, java.lang.Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 java.lang.Object setEL(java.lang.String key, java.lang.Object value)
          Deprecated. use instead setEL(railo.runtime.type.Collection.Key, Object)
 int size()
           
 
Methods inherited from interface railo.runtime.dump.Dumpable
toDumpData
 
Methods inherited from interface railo.runtime.type.Iteratorable
iterator, keyIterator
 
Methods inherited from interface railo.runtime.op.Castable
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, compareTo, compareTo, compareTo, compareTo
 

Method Detail

size

public int size()
Returns:
the size of the collection

keys

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

keysAsString

public java.lang.String[] keysAsString()
Deprecated. use instead keys()

Returns:
returns a string array of all keys in the collection

remove

public java.lang.Object remove(Collection.Key key)
                        throws PageException
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 java.lang.Object removeEL(Collection.Key key)
removes value from collection and return it when it exists, otherwise returns null

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

clear

public void clear()
clears the collection


get

public java.lang.Object get(java.lang.String key)
                     throws PageException
Deprecated. use instead get(railo.runtime.type.Collection.Key)

return a value from the collection

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

get

public java.lang.Object get(Collection.Key key)
                     throws PageException
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 java.lang.Object get(java.lang.String key,
                            java.lang.Object defaultValue)
Deprecated. use instead get(railo.runtime.type.Collection.Key, Object)

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 java.lang.Object get(Collection.Key key,
                            java.lang.Object defaultValue)
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

set

public java.lang.Object set(java.lang.String key,
                            java.lang.Object value)
                     throws PageException
Deprecated. use instead set(railo.runtime.type.Collection.Key, Object)

sets a value to the collection

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

set

public java.lang.Object set(Collection.Key key,
                            java.lang.Object value)
                     throws PageException
sets a value to the collection

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

setEL

public java.lang.Object setEL(java.lang.String key,
                              java.lang.Object value)
Deprecated. use instead setEL(railo.runtime.type.Collection.Key, Object)

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 java.lang.Object setEL(Collection.Key key,
                              java.lang.Object value)
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

clone

public java.lang.Object clone()
Returns:
this object cloned

duplicate

public Collection duplicate(boolean deepCopy)

containsKey

public boolean containsKey(java.lang.String key)
Deprecated. use instead containsKey(railo.runtime.type.Collection.Key)

contains this key

Parameters:
key -
Returns:
returns if collection has a key with given name

containsKey

public boolean containsKey(Collection.Key key)
contains this key

Parameters:
key -
Returns:
returns if collection has a key with given name