railo.runtime.type.util
Class StructSupport

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Collection, Iteratorable, Sizeable, Struct
Direct Known Subclasses:
CallerImpl, ClusterNotSupported, CollectionStruct, ComponentImpl, ComponentScopeShadow, ComponentScopeThis, ComponentWrap, FileStreamWrapper, Image, LocalNotSupportedScope, MapAsStruct, ObjectStruct, PDFDocument, RequestImpl, StorageScopeImpl, StructImpl, StructImplKey, SVStruct, ThreadsImpl, UndefinedImpl, UrlFormImpl, XMLAttributes, XMLNodeStruct

public abstract class StructSupport
extends Object
implements Map, Struct, Sizeable

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
 
Fields inherited from interface railo.runtime.type.Struct
TYPE_LINKED, TYPE_REGULAR, TYPE_SYNC, TYPE_WEAKED
 
Constructor Summary
StructSupport()
           
 
Method Summary
 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(Object key)
           
 boolean containsKey(String key)
          contains this key
 boolean containsValue(Object value)
           
 Set entrySet()
           
 boolean equals(Object obj)
           
 Object get(Object key)
           
 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
static ExpressionException invalidKey(String[] keys, Collection.Key key)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 Set keySet()
           
 Object put(Object key, Object value)
           
 void putAll(Map t)
           
 Object remove(Object key)
           
 Object set(String key, Object value)
          sets a value to the collection
 Object setEL(String key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
 long sizeOf()
          return the size of the object
 DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties)
          method to print out information to a object as HTML
 String toString()
           
 Iterator valueIterator()
           
 Collection values()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.Collection
clear, containsKey, duplicate, get, get, keys, keysAsString, remove, removeEL, set, setEL, size
 
Methods inherited from interface railo.runtime.type.Iteratorable
keyIterator
 
Methods inherited from interface java.util.Map
clear, hashCode, size
 

Constructor Detail

StructSupport

public StructSupport()
Method Detail

invalidKey

public static ExpressionException invalidKey(String[] keys,
                                             Collection.Key key)

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:
Sizeable.sizeOf()

entrySet

public Set entrySet()
Specified by:
entrySet in interface Map
See Also:
Map.entrySet()

get

public final Object get(Object key)
Specified by:
get in interface Map
See Also:
Map.get(java.lang.Object)

isEmpty

public final boolean isEmpty()
Specified by:
isEmpty in interface Map
See Also:
Map.isEmpty()

keySet

public Set keySet()
Specified by:
keySet in interface Map
See Also:
Map.keySet()

put

public final Object put(Object key,
                        Object value)
Specified by:
put in interface Map
See Also:
java.util.Map#put(K, V)

putAll

public final void putAll(Map t)
Specified by:
putAll in interface Map
See Also:
Map.putAll(java.util.Map)

remove

public final Object remove(Object key)
Specified by:
remove in interface Map
See Also:
Map.remove(java.lang.Object)

clone

public final Object clone()
Specified by:
clone in interface Collection
Overrides:
clone in class Object
Returns:
this object cloned
See Also:
Object.clone()

containsKey

public final boolean containsKey(Object key)
Specified by:
containsKey in interface Map
See Also:
Map.containsKey(java.lang.Object)

containsKey

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

Specified by:
containsKey in interface Collection
Returns:
returns if collection has a key with given name
See Also:
Collection.containsKey(java.lang.String)

get

public final 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

Specified by:
get in interface Collection
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 final Object get(String key)
                 throws PageException
Description copied from interface: Collection
return a value from the collection

Specified by:
get in interface Collection
Parameters:
key - key of the value to get
Returns:
value on key position
Throws:
PageException
See Also:
Collection.get(java.lang.String)

set

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

Specified by:
set in interface Collection
Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException
See Also:
Collection.set(java.lang.String, java.lang.Object)

setEL

public final 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

Specified by:
setEL in interface Collection
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)

toDumpData

public DumpData toDumpData(PageContext pageContext,
                           int maxlevel,
                           DumpProperties properties)
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:
Dumpable.toDumpData(railo.runtime.PageContext, int, railo.runtime.dump.DumpProperties)

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
See Also:
Castable.castToBooleanValue()

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
See Also:
Castable.castToBoolean(java.lang.Boolean)

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
See Also:
Castable.castToDoubleValue()

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
See Also:
Castable.castToDoubleValue(double)

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
See Also:
Castable.castToDateTime()

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
See Also:
Castable.castToDateTime(railo.runtime.type.dt.DateTime)

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
See Also:
Castable.castToString()

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
See Also:
Castable.castToString(java.lang.String)

compareTo

public int compareTo(boolean b)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
railo.runtime.op.Castable#compare(boolean)

compareTo

public int compareTo(DateTime dt)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
Castable.compareTo(railo.runtime.type.dt.DateTime)

compareTo

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

compareTo

public int compareTo(String str)
              throws PageException
Specified by:
compareTo in interface Castable
Throws:
PageException
See Also:
Castable.compareTo(java.lang.String)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

values

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

containsValue

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

iterator

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

valueIterator

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

equals

public boolean equals(Object obj)
Specified by:
equals in interface Map
Overrides:
equals in class Object


Copyright © 2012 Railo