|
|
 |
Article:
 |
 |
Non-Extractive Parsing for XML
|
| Subject: |
Many misunderstandings... |
| Date: |
2004-05-22 13:42:49 |
| From: |
mweiher |
|
Response to: Many misunderstandings...
|
|
|
You are not abstracting. You can hide an optimized implementation behind an interface that looks just like a regular string. In fact, this is exactly what MPWXmlKit does. To the client, it just provides NSString-compatible objects. Inside they are highly optimized and just point inisde the original data, but if something happens that can't be handled that way, it can resort to returning a more "normal" NSString.
Polymorphism is a wonderful thing ;-)
Marcel
|
- Many misunderstandings...
2004-05-23 03:14:53 Brian Ewins
[Reply]
Unfortunately in this case, its not me thats not abstracting - its Sun. Yeah, sure you can do all kinds of funky things behind an interface, but String is a final class in java (ie you can't implement your own or subclass it, it just is what it is; hey it wasn't my idea!).
ne_parseInt(String s1, int offset, int length) still isn't the signature to replace "Java's parseInt", if you want to avoid extraction. ne_parseInt(CharSequence s1, int offset, int length), possibly.
|
 |
Sponsored By:
|