xp-framework/rfc — Issue #101: Add lang.types.String
Author: thekid
Created: 2011-10-17 15:53:56+00:00
State: closed
Labels: framework, obsoleted

Scope of Change
====
A new class lang.types.String will be added.

Rationale
====
Complement rest of the classes in lang.types.

Functionality
====
Classes currently in lang.types:

```
* lang.types.ArrayList
* lang.types.Number
* lang.types.Byte
* lang.types.Double
* lang.types.Float
* lang.types.Integer
* lang.types.Long
* lang.types.Short

```

New class lang.types.String (minimalistic because wrapper type):

```php
intern= $initial;
}

function length() {
return strlen($this->intern);
}

function hashCode() {
return DJBX33AHashImplementation::hashOf($this->intern);
}

function equals(&$cmp) {
return is_a($cmp, 'String') && $this->intern == $cmp->intern;
}

function toString() {
return $this->intern;
}
}
?>
```

Security considerations
====
n/a

Speed impact
====
n/a

Dependencies
====
- Removal or renaming of text.String (e.g. to text.StringBuffer)
- Move of DJBX33AHashImplementation to lang.types or a more generic
place

Related documents
====
n/a