Summary: | CharSequence | ||
---|---|---|---|
Product: | ORO | Reporter: | ArtemGr <artem> |
Component: | Main | Assignee: | Jakarta Notifications Mailing List <notifications> |
Status: | CLOSED LATER | ||
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | Unknown | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://java.sun.com/j2se/1.4.2/docs/api/java/lang/CharSequence.html |
Description
ArtemGr
2004-11-05 12:08:17 UTC
We have avoided making use of J2SE 1.4 features to maintain backward compatibility. We intend to use conditional compilation to provide different versions for J2ME, J2SE < 1.4 and J2SE >= 1.4. At that time, we will make use of 1.4isms like CharSequence. Ability to use char[] is even better. It is usually possible to effectively wrap/unwrap char[] arrays into whatever CharSequence objects we have. And no J2SE 1.4 dependency required. org.apache.oro.text.perl.Perl5Util.match seems to have char[] argument already. May I ask for other methods to have fast char[] variants also? In particular, for: org.apache.oro.text.perl.Perl5Util.split( Collection, String, String, int ) org.apache.oro.text.perl.Perl5Util.substitute( StringBuffer, String, String ) and org.apache.oro.text.regex.MatchResult.group( int ) Afterthought, it is less important to have a char[] alternative to org.apache.oro.text.regex.MatchResult.group( int ) since in most cases we will append the result to something else using String.getChars. But org.apache.oro.text.perl.Perl5Util.split( Collection, String, String, int ) org.apache.oro.text.perl.Perl5Util.substitute( StringBuffer, String, String ) are still important, becouse their arguments might be quite big and there is no way to wrap existing char[] array into String without needless copying. For org.apache.oro.text.perl.Perl5Util.split it is even better to use the org.apache.oro.text.regex.PatternMatcherInput as parameter. split already uses PatternMatcherInput! And PatternMatcherInput allows to specify a part of char[] array - perfect. It seems quite reasonable to include a method which accepts PatternMatcherInput directly, instead of creating it every time from String. Am I missing something? : ) The org.apache.oro.text.regex package contains already everything i need to work with char[] arrays. Sorry for the buzz. |