thekid/rfc — Issue #101: RFC 0101: Add lang.types.String
Author: thekid
Created: 2011-10-09 15:06:03+00:00
State: open
Labels: rfc

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

Comments
====