KeyValue

Kind of class:class
Inherits from:none
Author:Arthur Clemens
Classpath:org.asapframework.data.KeyValue
File last modified:Thursday, 12 October 2006, 11:19:40
Key-value object class.

Summary


Constructor
  • KeyValue (inKey:String, inValue:Object)
    • Creates a new KeyValue object.
Instance properties
Instance methods
  • stringify (inDelimiter:String) : String
    • Creates a String key inDelimiter value.
  • stringifyWithFormattedString (inFormattedString:String) : String
    • Returns the key-value pairs as formatted string.
  • toString : String
  • replace (inSource:String, inRemove:String, inReplace:String) : String
    • Replaces a string with another string.

Constructor

KeyValue

function KeyValue (
inKey:String, inValue:Object)

Creates a new KeyValue object.
Parameters:
inKey :
(optional) key
inValue:
(optional) value

Instance properties

key

key:String
(read)

value

value:Object
(read)

Instance methods

replace

private function replace (
inSource:String, inRemove:String, inReplace:String) : String

Replaces a string with another string. See org.asapframework.util.StringUtils.replace.

stringify

function stringify (
inDelimiter:String) : String

Creates a String key inDelimiter value.
Parameters:
inDelimiter:
connecting string between key and value
Returns:
  • A new String with key, inDelimiter, value. Returns an empty String if value is empty or undefined.

stringifyWithFormattedString

function stringifyWithFormattedString (
inFormattedString:String) : String

Returns the key-value pairs as formatted string.
Parameters:
inFormattedString:
accepts %1 and %2 as format parameters
Returns:
  • A new string with the key-values formatted.
Example:
  • var author:KeyValue= new KeyValue("Author", "Tolstoj");
    var myHtml:String = author.stringifyWithFormattedString("<font color='#666666'>%1</font> <font color='#000000'>%2</font>");
    Result:
    Author Tolstoj

toString

function toString (
) : String