Java Doc for CharArray.java in  » Development » Javolution » javolution » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » Javolution » javolution.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javolution.text.CharArray

CharArray
final public class CharArray implements CharSequence,Comparable(Code)

This class represents a character sequence backed up by a char array. Instances of this class are mutable and are typically used/reused to hold temporary text (unlike String they do not forces object creation).

Instances of this classes have the following properties:

  • They support equality or lexical comparison with any CharSequence (e.g. String).
  • They have the same hashcode than String and can be used to retrieve data from maps for which the keys are String instances.
  • They support fast conversions to primitive types (e.g. CharArray.toBoolean() Boolean , CharArray.toInt int ).


author:
   Jean-Marie Dautelle
version:
   4.0, June 16, 2006



Constructor Summary
public  CharArray()
     Default constructor.
public  CharArray(String string)
     Creates a character array from the specified String.
public  CharArray(CharSequence csq)
     Creates a character array from the specified character sequence.

Method Summary
public  char[]array()
     Returns the underlying array (read-only).
public  charcharAt(int index)
     Returns the character at the specified index.
Parameters:
  index - the index of the character starting at 0.
public  intcompareTo(Object seq)
     Compares this character array with the specified character sequence lexicographically.
Parameters:
  seq - the character sequence to be compared.
public  booleanequals(Object that)
     Compares this character sequence against the specified object (String or CharSequence).
Parameters:
  that - the object to compare with.
public  booleanequals(CharArray that)
     Compares this character array against the specified CharArray .
Parameters:
  that - the character array to compare with.
public  booleanequals(String str)
     Compares this character array against the specified String. In case of equality, the CharArray keeps a reference to the String for future comparisons.
Parameters:
  str - the string to compare with.
public  inthashCode()
     Returns the hash code for this CharArray .
public  intlength()
     Returns the length of this character sequence.
public  intoffset()
     Returns the offset of the first character in the underlying array.
final public  intoffsetOf(CharSequence csq)
     Returns the offset within this character array of the first occurrence of the specified characters sequence searching forward from this character array CharArray.offset() to offset() + length().
Parameters:
  csq - a character sequence searched for.
final public  intoffsetOf(char c)
     Returns the offset within this character array of the first occurrence of the specified character searching forward from this character array CharArray.offset() to offset() + length().
Parameters:
  c - the character to search for.
public  CharArraysetArray(char[] array, int offset, int length)
     Sets the underlying array of this CharArray.
Parameters:
  offset - the new offset.
Parameters:
  array - the new underlying array.
Parameters:
  length - the new length.
public  CharSequencesubSequence(int start, int end)
     Returns a new character sequence that is a subsequence of this sequence.
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive.
public  booleantoBoolean()
     Returns the boolean represented by this character array.
public  inttoInt()
     Returns the decimal int represented by this character array.
public  inttoInt(int radix)
     Returns the int represented by this character array in the specified radix.
Parameters:
  radix - the radix (e.g.
public  longtoLong()
     Returns the decimal long represented by this character array.
public  longtoLong(int radix)
     Returns the decimal long represented by this character array in the specified radix.
Parameters:
  radix - the radix (e.g.
public  StringtoString()
     Returns the String corresponding to this character sequence.


Constructor Detail
CharArray
public CharArray()(Code)
Default constructor.



CharArray
public CharArray(String string)(Code)
Creates a character array from the specified String.
Parameters:
  string - the string source.



CharArray
public CharArray(CharSequence csq)(Code)
Creates a character array from the specified character sequence.
Parameters:
  csq - the character sequence source.




Method Detail
array
public char[] array()(Code)
Returns the underlying array (read-only). The array returned should not be modified (unfortunately there is no way to make an array immutable in Java). the underlying array.



charAt
public char charAt(int index)(Code)
Returns the character at the specified index.
Parameters:
  index - the index of the character starting at 0. the character at the specified index of this character sequence.
throws:
  IndexOutOfBoundsException - if ((index < 0) || (index >= length))



compareTo
public int compareTo(Object seq)(Code)
Compares this character array with the specified character sequence lexicographically.
Parameters:
  seq - the character sequence to be compared. FastComparator.LEXICAL.compare(this, seq)
throws:
  ClassCastException - if the specifed object is not aCharSequence.



equals
public boolean equals(Object that)(Code)
Compares this character sequence against the specified object (String or CharSequence).
Parameters:
  that - the object to compare with. true if both objects represent the same sequence;false otherwise.



equals
public boolean equals(CharArray that)(Code)
Compares this character array against the specified CharArray .
Parameters:
  that - the character array to compare with. true if both objects represent the same sequence;false otherwise.



equals
public boolean equals(String str)(Code)
Compares this character array against the specified String. In case of equality, the CharArray keeps a reference to the String for future comparisons.
Parameters:
  str - the string to compare with. true if both objects represent the same sequence;false otherwise.



hashCode
public int hashCode()(Code)
Returns the hash code for this CharArray .

Note: Returns the same hashCode as java.lang.String (consistent with CharArray.equals )

the hash code value.



length
public int length()(Code)
Returns the length of this character sequence. the number of characters (16-bits Unicode) composing thischaracter sequence.



offset
public int offset()(Code)
Returns the offset of the first character in the underlying array. the offset of the first character.



offsetOf
final public int offsetOf(CharSequence csq)(Code)
Returns the offset within this character array of the first occurrence of the specified characters sequence searching forward from this character array CharArray.offset() to offset() + length().
Parameters:
  csq - a character sequence searched for. the offset of the specified character sequence in the range[offset(), offset() + length()[ or -1 if the character sequence is not found.



offsetOf
final public int offsetOf(char c)(Code)
Returns the offset within this character array of the first occurrence of the specified character searching forward from this character array CharArray.offset() to offset() + length().
Parameters:
  c - the character to search for. the offset of the specified character in the range[offset(), offset() + length()[ or -1 if the character is not found.



setArray
public CharArray setArray(char[] array, int offset, int length)(Code)
Sets the underlying array of this CharArray.
Parameters:
  offset - the new offset.
Parameters:
  array - the new underlying array.
Parameters:
  length - the new length. this



subSequence
public CharSequence subSequence(int start, int end)(Code)
Returns a new character sequence that is a subsequence of this sequence.
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive. the character sequence starting at the specifiedstart position and ending just before the specifiedend position.
throws:
  IndexOutOfBoundsException - if (start < 0) || (end < 0) ||(start > end) || (end > this.length())



toBoolean
public boolean toBoolean()(Code)
Returns the boolean represented by this character array. the corresponding boolean value.
throws:
  NumberFormatException - if this character sequencedoes not contain a parsable boolean.



toInt
public int toInt()(Code)
Returns the decimal int represented by this character array. toInt(10)
throws:
  NumberFormatException - if this character sequencedoes not contain a parsable int.



toInt
public int toInt(int radix)(Code)
Returns the int represented by this character array in the specified radix.
Parameters:
  radix - the radix (e.g. 16 for hexadecimal). the corresponding int value.
throws:
  NumberFormatException - if this character sequencedoes not contain a parsable int.



toLong
public long toLong()(Code)
Returns the decimal long represented by this character array. the corresponding long value.
throws:
  NumberFormatException - if this character sequencedoes not contain a parsable long.



toLong
public long toLong(int radix)(Code)
Returns the decimal long represented by this character array in the specified radix.
Parameters:
  radix - the radix (e.g. 16 for hexadecimal). the corresponding long value.
throws:
  NumberFormatException - if this character sequencedoes not contain a parsable long.



toString
public String toString()(Code)
Returns the String corresponding to this character sequence. The String returned is always allocated on the heap and can safely be referenced elsewhere. the java.lang.String for this character sequence.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.