| Package | ch.capi.data.text |
| Class | public class Properties |
| Inheritance | Properties Object |
| Implements | IProperties |
| Property | Defined By | ||
|---|---|---|---|
| variables : IMap [read-only]
Defines the variables contained in the Properties. | Properties | ||
| Method | Defined By | ||
|---|---|---|---|
Properties(source:IMap = null)
Creates a new Properties object. | Properties | ||
clear():void
Deletes all the key/value pairs of the IMap. | Properties | ||
getUpdatedValue(key:String):String
Retrieves the value with no variables in it. | Properties | ||
getValue(key:String):*
Retrieves the value of the specified key. | Properties | ||
getValueAsBoolean(key:String):Boolean
Retrieves the value of the specified key as Boolean. | Properties | ||
getValueAsColor(key:String):uint
Retrieves the value of the specified key as color (unsigned int). | Properties | ||
getValueAsFloat(key:String):Number
Retrieves the value of the specified key as float. | Properties | ||
getValueAsInt(key:String):int
Retrieves the value of the specified key as integer. | Properties | ||
getValueAsNumber(key:String):Number
Retrieves the value of the specified key as Number. | Properties | ||
getValueAsUnsigned(key:String):uint
Retrieves the value of the specified key as unsigned integer. | Properties | ||
[static]
Parses the specified String. | Properties | ||
parseData(src:String, replaceChars:Boolean = true):void
Parses the specified source. | Properties | ||
remove(key:String):*
Removes the specified key. | Properties | ||
setValue(key:String, value:*):*
Maps the specified key with the value. | Properties | ||
toString():String
Returns a String representation of the Properties
object. | Properties | ||
| Method | Defined By | ||
|---|---|---|---|
replaceEscapedChars(str:String):String
Replaces the escaped chars in the specified String and
return the new String. | Properties | ||
| variables | property |
variables:IMap [read-only]
Defines the variables contained in the Properties.
public function get variables():IMap| Properties | () | Constructor |
public function Properties(source:IMap = null)
Creates a new Properties object.
source:IMap (default = null) — The source IMap. If not defined, then a new
instance of DictionnaryMap will be created.
|
| clear | () | method |
| 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.
|
String — The value with no variable in it.
|
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.
|
* — The value or null.
|
| getValueAsBoolean | () | method |
public function getValueAsBoolean(key:String):BooleanRetrieves the value of the specified key as Boolean.
Parameters
key:String — The key.
|
Boolean — The value as Boolean.
|
Error If — the value is not a Boolean.
|
See also
| getValueAsColor | () | method |
public function getValueAsColor(key:String):uintRetrieves the value of the specified key as color (unsigned int).
Parameters
key:String — The key.
|
uint — The value as color.
|
Error If — the value is not a color value.
|
See also
| getValueAsFloat | () | method |
public function getValueAsFloat(key:String):NumberRetrieves the value of the specified key as float.
Parameters
key:String — The key.
|
Number — The value as Number.
|
Error If — the value is not an Number.
|
See also
| getValueAsInt | () | method |
public function getValueAsInt(key:String):intRetrieves the value of the specified key as integer.
Parameters
key:String — The key.
|
int — The value as integer.
|
Error If — the value is not an integer.
|
See also
| getValueAsNumber | () | method |
public function getValueAsNumber(key:String):NumberRetrieves the value of the specified key as Number.
Parameters
key:String — The key.
|
Number — The value as Number.
|
Error If — the value is not an Number.
|
See also
| getValueAsUnsigned | () | method |
public function getValueAsUnsigned(key:String):uintRetrieves the value of the specified key as unsigned integer.
Parameters
key:String — The key.
|
uint — The value as unsigned integer.
|
Error If — the value is not an unsigned integer.
|
See also
| parse | () | method |
public static function parse(properties:String, source:IMap = null, replaceChars:Boolean = true):Properties
Parses the specified String.
Parameters
properties:String — The String containing the properties.
| |
source:IMap (default = null) — TThe source IMap. If not defined, then a new
instance of DictionnaryMap will be created.
| |
replaceChars:Boolean (default = true) |
Properties — The created Properties instance.
|
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, ...).
|
See also
| remove | () | method |
public function remove(key:String):*Removes the specified key.
Parameters
key:String — The key to remove.
|
* — The value of the key or null if the key was not defined.
|
| replaceEscapedChars | () | method |
protected function replaceEscapedChars(str:String):String
Replaces the escaped chars in the specified String and
return the new String.
The special chars that will be replaced :
Parameters
str:String — The source String.
|
String — A new String with replaced chars.
|
| 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.
|
* — The old value or null if the value was not defined.
|
| toString | () | method |
public function toString():String
Returns a String representation of the Properties
object. The String contains the list of the keys with their values.
String — A String representation of the Properties object.
|