railo.runtime.type
Class KeyImpl

java.lang.Object
  extended by railo.runtime.type.KeyImpl
All Implemented Interfaces:
Externalizable, Serializable, Comparable, Castable, Collection.Key, Sizeable
Direct Known Subclasses:
ArgumentIntKey

public class KeyImpl
extends Object
implements Collection.Key, Castable, Comparable, Sizeable, Externalizable

See Also:
Serialized Form

Constructor Summary
KeyImpl()
           
 
Method Summary
static Collection.Key _const(String key)
           
 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
 char charAt(int index)
          return char at given position
 int compareTo(boolean b)
           
 int compareTo(DateTime dt)
           
 int compareTo(double d)
           
 int compareTo(Object o)
           
 int compareTo(String str)
           
 boolean equals(Object other)
           
 boolean equalsIgnoreCase(Collection.Key other)
          compare to object, ignore case of input
 int getId()
           
static Collection.Key getInstance(String key)
          used for static iniatisation of a key object (used by compiler)
 String getLowerString()
          return key as lower case String
 String getString()
          return key as String
 String getUpperString()
          return key as upper case String
 int hashCode()
           
static Collection.Key init(String key)
          for dynamic loading of key objects
static Collection.Key intern(String key)
           
 int length()
          Returns the length of this string.
 char lowerCharAt(int index)
          return lower case char a given position
 void readExternal(ObjectInput in)
           
 long sizeOf()
          return the size of the object
static Array toArray(Collection.Key[] keys)
           
static Collection.Key toKey(Object obj)
           
static Collection.Key toKey(Object obj, Collection.Key defaultValue)
           
static Collection.Key[] toKeyArray(String[] arr)
           
static String toList(Collection.Key[] array, String delimiter)
           
static Array toLowerCaseArray(Collection.Key[] keys)
           
static String toLowerCaseList(Collection.Key[] array, String delimiter)
           
 String toString()
           
static Array toUpperCaseArray(Collection.Key[] keys)
           
static String toUpperCaseList(Collection.Key[] array, String delimiter)
           
 char upperCharAt(int index)
          return upper case char a given position
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyImpl

public KeyImpl()
Method Detail

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

init

public static Collection.Key init(String key)
for dynamic loading of key objects

Parameters:
string -
Returns:

_const

public static Collection.Key _const(String key)

getInstance

public static Collection.Key getInstance(String key)
used for static iniatisation of a key object (used by compiler)

Parameters:
string -
Returns:

intern

public static Collection.Key intern(String key)

charAt

public char charAt(int index)
Description copied from interface: Collection.Key
return char at given position

Specified by:
charAt in interface Collection.Key
Returns:
character at given position

lowerCharAt

public char lowerCharAt(int index)
Description copied from interface: Collection.Key
return lower case char a given position

Specified by:
lowerCharAt in interface Collection.Key
Returns:
lower case char from given position

upperCharAt

public char upperCharAt(int index)
Description copied from interface: Collection.Key
return upper case char a given position

Specified by:
upperCharAt in interface Collection.Key
Returns:
upper case char from given position

getLowerString

public String getLowerString()
Description copied from interface: Collection.Key
return key as lower case String

Specified by:
getLowerString in interface Collection.Key

getUpperString

public String getUpperString()
Description copied from interface: Collection.Key
return key as upper case String

Specified by:
getUpperString in interface Collection.Key

toString

public String toString()
Overrides:
toString in class Object

getString

public String getString()
Description copied from interface: Collection.Key
return key as String

Specified by:
getString in interface Collection.Key

equals

public boolean equals(Object other)
Overrides:
equals in class Object

equalsIgnoreCase

public boolean equalsIgnoreCase(Collection.Key other)
Description copied from interface: Collection.Key
compare to object, ignore case of input

Specified by:
equalsIgnoreCase in interface Collection.Key
Returns:
is equal to given key?

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getId

public int getId()
Specified by:
getId in interface Collection.Key
Returns:
return id for this key, this key is unique for the system but ignore case of input

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

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

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

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

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

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

toUpperCaseArray

public static Array toUpperCaseArray(Collection.Key[] keys)

toLowerCaseArray

public static Array toLowerCaseArray(Collection.Key[] keys)

toArray

public static Array toArray(Collection.Key[] keys)

toUpperCaseList

public static String toUpperCaseList(Collection.Key[] array,
                                     String delimiter)

toList

public static String toList(Collection.Key[] array,
                            String delimiter)

toLowerCaseList

public static String toLowerCaseList(Collection.Key[] array,
                                     String delimiter)

toKey

public static Collection.Key toKey(Object obj,
                                   Collection.Key defaultValue)

toKey

public static Collection.Key toKey(Object obj)
                            throws CasterException
Throws:
CasterException

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

length

public int length()
Description copied from interface: Collection.Key
Returns the length of this string.

Specified by:
length in interface Collection.Key
Returns:
length of the string

toKeyArray

public static Collection.Key[] toKeyArray(String[] arr)


Copyright © 2012 Railo