railo.runtime.type
Class StructImpl

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
      extended by railo.runtime.type.StructImpl
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Collection, Iteratorable, Sizeable, Struct
Direct Known Subclasses:
CastableStruct, CatchBlock, DoubleStruct, FeedStruct, HttpSessionBindingListenerStruct, ReadOnlyStruct, ScopeSupport, StructImplString

public class StructImpl
extends StructSupport

cold fusion data type struct

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface railo.runtime.type.Collection
Collection.Key
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static int TYPE_SOFT
           
 
Fields inherited from interface railo.runtime.type.Struct
TYPE_LINKED, TYPE_REGULAR, TYPE_SYNC, TYPE_WEAKED
 
Constructor Summary
StructImpl()
          default constructor
StructImpl(int type)
          This implementation spares its clients from the unspecified, generally chaotic ordering provided by normally Struct , without incurring the increased cost associated with TreeMap.
 
Method Summary
 void clear()
          clears the collection
 boolean containsKey(Collection.Key key)
          contains this key
 boolean containsValue(Object value)
           
static void copy(Struct src, Struct trg, boolean deepCopy)
           
 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
 Iterator keyIterator()
           
 Collection.Key[] keys()
           
 String[] keysAsString()
           
 Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 Object remove(String key)
           
 Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 int size()
           
 Iterator valueIterator()
           
 Collection values()
           
 
Methods inherited from class railo.runtime.type.util.StructSupport
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, clone, compareTo, compareTo, compareTo, compareTo, containsKey, containsKey, entrySet, equals, get, get, get, invalidKey, isEmpty, iterator, keySet, put, putAll, remove, set, setEL, sizeOf, toDumpData, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Field Detail

TYPE_SOFT

public static final int TYPE_SOFT
See Also:
Constant Field Values
Constructor Detail

StructImpl

public StructImpl()
default constructor


StructImpl

public StructImpl(int type)
This implementation spares its clients from the unspecified, generally chaotic ordering provided by normally Struct , without incurring the increased cost associated with TreeMap. It can be used to produce a copy of a map that has the same order as the original

Parameters:
doubleLinked -
Method Detail

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

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

size

public int size()
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

keysAsString

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

remove

public Object remove(String key)
              throws PageException
Throws:
PageException
See Also:
railo.runtime.type.Collection#remove(java.lang.String)

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
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
See Also:
Collection.removeEL(railo.runtime.type.Collection.Key)

clear

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

See Also:
Collection.clear()

duplicate

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

copy

public static void copy(Struct src,
                        Struct trg,
                        boolean deepCopy)

keyIterator

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

valueIterator

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

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)

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map
Overrides:
containsValue in class StructSupport
See Also:
Map.containsValue(java.lang.Object)

values

public Collection values()
Specified by:
values in interface Map
Overrides:
values in class StructSupport
See Also:
Map.values()


Copyright © 2012 Railo