Packagech.capi.data.text
Interfacepublic interface IProperties
Implementors Properties

An IProperties object can store and parse some key/value pairs.



Public Properties
 PropertyDefined By
  variables : IMap
[read-only] Defines the variables contained in the Properties.
IProperties
Public Methods
 MethodDefined By
  
clear():void
Deletes all the key/value pairs of the IMap.
IProperties
  
getUpdatedValue(key:String):String
Retrieves the value with no variables in it.
IProperties
  
getValue(key:String):*
Retrieves the value of the specified key.
IProperties
  
getValueAsBoolean(key:String):Boolean
Retrieves the value of the specified key as Boolean.
IProperties
  
getValueAsColor(key:String):uint
Retrieves the value of the specified key as color (unsigned int).
IProperties
  
getValueAsFloat(key:String):Number
Retrieves the value of the specified key as float.
IProperties
  
getValueAsInt(key:String):int
Retrieves the value of the specified key as integer.
IProperties
  
getValueAsNumber(key:String):Number
Retrieves the value of the specified key as Number.
IProperties
  
getValueAsUnsigned(key:String):uint
Retrieves the value of the specified key as unsigned integer.
IProperties
  
parseData(src:String, replaceChars:Boolean = true):void
Parses the specified source.
IProperties
  
remove(key:String):*
Removes the specified key.
IProperties
  
setValue(key:String, value:*):*
Maps the specified key with the value.
IProperties
Property Detail
variablesproperty
variables:IMap  [read-only]

Defines the variables contained in the Properties.


Implementation
    public function get variables():IMap
Method Detail
clear()method
public function clear():void

Deletes all the key/value pairs of the IMap.

See also

getUpdatedValue()method 
public function getUpdatedValue(key:String):String

Retrieves the value with no variables in it. That means that the value is retrieved as a String and then the source IMap is used to replace all the variables in it.

Parameters

key:String — The key.

Returns
String — The value with no variable in it.

Throws
Error If — the value is not a String.

See also

getValue()method 
public function getValue(key:String):*

Retrieves the value of the specified key. If the key doesn't exist, then null is returned.

Parameters

key:String — The key.

Returns
* — The value or null.
getValueAsBoolean()method 
public function getValueAsBoolean(key:String):Boolean

Retrieves the value of the specified key as Boolean.

Parameters

key:String — The key.

Returns
Boolean — The value as Boolean.

Throws
Error If — the value is not a Boolean.

See also

getValueAsColor()method 
public function getValueAsColor(key:String):uint

Retrieves the value of the specified key as color (unsigned int).

Parameters

key:String — The key.

Returns
uint — The value as color.

Throws
Error If — the value is not a color value.

See also

getValueAsFloat()method 
public function getValueAsFloat(key:String):Number

Retrieves the value of the specified key as float.

Parameters

key:String — The key.

Returns
Number — The value as Number.

Throws
Error If — the value is not an Number.

See also

getValueAsInt()method 
public function getValueAsInt(key:String):int

Retrieves the value of the specified key as integer.

Parameters

key:String — The key.

Returns
int — The value as integer.

Throws
Error If — the value is not an integer.

See also

getValueAsNumber()method 
public function getValueAsNumber(key:String):Number

Retrieves the value of the specified key as Number.

Parameters

key:String — The key.

Returns
Number — The value as Number.

Throws
Error If — the value is not an Number.

See also

getValueAsUnsigned()method 
public function getValueAsUnsigned(key:String):uint

Retrieves the value of the specified key as unsigned integer.

Parameters

key:String — The key.

Returns
uint — The value as unsigned integer.

Throws
Error If — the value is not an unsigned integer.

See also

parseData()method 
public function parseData(src:String, replaceChars:Boolean = true):void

Parses the specified source. The source must be a list of variables formatted like that key=value on each line. The old key/value pairs are kept.

Parameters

src:String — The source to parse.
 
replaceChars:Boolean (default = true) — Tells the parser to replace the special chars (\n, \t, ...).

remove()method 
public function remove(key:String):*

Removes the specified key.

Parameters

key:String — The key to remove.

Returns
* — The value of the key or null if the key was not defined.
setValue()method 
public function setValue(key:String, value:*):*

Maps the specified key with the value. If the key is already set, the value will be erased by the new one.

Parameters

key:String — The key.
 
value:* — The value.

Returns
* — The old value or null if the value was not defined.