Java Doc for Text.java in  » Science » javolution-5.2 » 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 » Science » javolution 5.2 » javolution.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javolution.text.Text

Text
final public class Text implements CharSequence,Comparable,XMLSerializable,ValueType,Realtime(Code)

This class represents an immutable character sequence with fast Text.concat concatenation , Text.insert insertion and Text.delete deletion capabilities (O[Log(n)]) instead of O[n] for StringBuffer/StringBuilder).

This class has the same methods as Java String and .NET String with the following benefits:

  • No need for an intermediate StringBuffer / StringBuilder in order to manipulate textual documents (insertion, deletion or concatenation).
  • Bug free. They are not plagued by the String.substring memory leak bug (when small substrings prevent memory from larger string from being garbage collected).
  • More flexible as they allows for search and comparison with any java.lang.String or CharSequence.
  • Support custom allocation policies (instances allocated on the "stack" when executing in a javolution.context.StackContext StackContext ).

Text literals should be explicitely Text.intern interned . Unlike strings literals and strings-value constant expressions, interning is not implicit. For example:[code] final static Text TRUE = Text.intern("true"); final static Text FALSE = Text.intern("false"); [/code] Interned texts are always allocated in ImmortalMemory (RTSJ VMs).

Text instances can be Text.println printed out directly (no intermediate String allocated). For example:[code] FastTable myTable ...; myTable.toText().println(); // Prints to System.out [/code]

Implementation Note: To avoid expensive copy operations , Text instances are broken down into smaller immutable sequences, they form a minimal-depth binary tree. The tree is maintained balanced automatically through tree rotations. Insertion/deletions are performed in O[Log(n)] instead of O[n] for StringBuffer/StringBuilder.


author:
   Jean-Marie Dautelle
author:
   Wilfried Middleton
version:
   5.1, July 1, 2007


Field Summary
final public static  TextEMPTY
     Holds an empty character sequence.

Constructor Summary
public  Text(String str)
     Creates a text holding the characters from the specified String .
Parameters:
  str - the string holding the character content.

Method Summary
public  charcharAt(int index)
     Returns the character at the specified index.
Parameters:
  index - the index of the character.
public  intcompareTo(Object csq)
     Compares this text to another character sequence or string lexicographically.
Parameters:
  csq - the character sequence to be compared.
public  Textconcat(Text that)
     Concatenates the specified text to the end of this text.
public  booleancontentEquals(CharSequence csq)
     Indicates if this text has the same character content as the specified character sequence.
Parameters:
  csq - the character sequence to compare with.
public  booleancontentEqualsIgnoreCase(CharSequence csq)
     Indicates if this text has the same character contend as the specified character sequence ignoring case considerations.
public  Objectcopy()
    
public  Textdelete(int start, int end)
     Returns the text without the characters between the specified indexes.
Parameters:
  start - the beginning index, inclusive.
Parameters:
  end - the ending index, exclusive.
public  intdepth()
     Returns the depth of the internal tree used to represent this text.
public  booleanendsWith(CharSequence suffix)
     Indicates if this text ends with the specified suffix.
Parameters:
  suffix - the suffix.
public  booleanequals(Object obj)
     Compares this text against the specified object for equality. Returns true if the specified object is a text having the same character sequence as this text.
public  voidgetChars(int start, int end, char dest, int destPos)
     Copies the characters from this text into the destination character array.
public  inthashCode()
     Returns the hash code for this text.
public  intindexOf(CharSequence csq)
     Returns the index within this text of the first occurrence of the specified character sequence searching forward.
Parameters:
  csq - a character sequence.
public  intindexOf(CharSequence csq, int fromIndex)
     Returns the index within this text of the first occurrence of the specified characters sequence searching forward from the specified index.
Parameters:
  csq - a character sequence.
Parameters:
  fromIndex - the index to start the search from.
public  intindexOf(char c, int fromIndex)
     Returns the index within this text of the first occurrence of the specified character, starting the search at the specified index.
Parameters:
  c - the character to search for.
Parameters:
  fromIndex - the index to start the search from.
public  intindexOfAny(CharSet charSet)
     Returns the index within this text of the first occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
public  intindexOfAny(CharSet charSet, int start)
     Returns the index within a region of this text of the first occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text.
public  intindexOfAny(CharSet charSet, int start, int length)
     Returns the index within a region of this text of the first occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text.
Parameters:
  length - the length of the region to search.
public  Textinsert(int index, Text txt)
     Returns the text having the specified text inserted at the specified location.
Parameters:
  index - the insertion position.
Parameters:
  txt - the text being inserted.
public static  Textintern(CharSequence csq)
     Returns a text equals to the specified character sequence from a pool of unique text instances in ImmortalMemory.
public static  Textintern(String str)
     Returns a text equals to the specified string from a pool of unique text instances in ImmortalMemory.
public  booleanisBlank()
     Indicates if all characters of this text are whitespaces (no characters greater than the space character).
public  booleanisBlank(int start, int length)
     Indicates if the specified sub-range of characters of this text are whitespaces (no characters greater than the space character).
public  intlastIndexOf(CharSequence csq)
     Returns the index within this text of the last occurrence of the specified characters sequence searching backward.
Parameters:
  csq - a character sequence.
public  intlastIndexOf(CharSequence csq, int fromIndex)
     Returns the index within this text of the last occurrence of the specified character sequence searching backward from the specified index.
Parameters:
  csq - a character sequence.
Parameters:
  fromIndex - the index to start the backward search from.
public  intlastIndexOf(char c, int fromIndex)
     Returns the index within this text of the first occurrence of the specified character, searching backward and starting at the specified index.
Parameters:
  c - the character to search for.
Parameters:
  fromIndex - the index to start the search backward from.
public  intlastIndexOfAny(CharSet charSet)
     Returns the index within this text of the last occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
public  intlastIndexOfAny(CharSet charSet, int start)
     Returns the index within a region of this text of the last occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text.
public  intlastIndexOfAny(CharSet charSet, int start, int length)
     Returns the index within a region of this text of the last occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text.
Parameters:
  length - the length of the region to search.
public  intlength()
     Returns the length of this text.
public  TextpadLeft(int len)
     Pads this text on the left with spaces to make the minimum total length as specified. The new length of the new text is equal to the original length plus (length()-len) spaces.
Parameters:
  len - the total number of characters to make this text equal to.
public  TextpadLeft(int len, char c)
     Pads this text on the left to make the minimum total length as specified. Spaces or the given Unicode character are used to pad with.
The new length of the new text is equal to the original length plus (length()-len) pad characters.
Parameters:
  len - the total number of characters to make this text equal to.
Parameters:
  c - the character to pad using.
public  TextpadRight(int len)
     Pads this text on the right with spaces to make the minimum total length as specified. The new length of the new text is equal to the original length plus (length()-len) spaces.
Parameters:
  len - the total number of characters to make this text equal to.
public  TextpadRight(int len, char c)
     Pads this text on the right to make the minimum total length as specified. Spaces or the given Unicode character are used to pad with.
The new length of the new text is equal to the original length plus (length()-len) pad characters.
Parameters:
  len - the total number of characters to make this text equal to.
Parameters:
  c - the character to pad using.
public  Textplus(Object obj)
     Returns the concatenation of this text and the textual representation of the specified object.
Parameters:
  obj - the object whose textual representation is appended.
public  voidprint()
     Prints out this text to System.out (UTF-8 encoding).
public  voidprint(Writer writer)
     Prints out this text to the specified writer.
public  voidprintln()
     Prints out this text to System.out and then terminates the line.
public  voidprintln(Writer writer)
     Prints out this text to the specified writer and then terminates the line.
public  Textreplace(CharSequence target, CharSequence replacement)
     Replaces each character sequence of this text that matches the specified target sequence with the specified replacement sequence.
Parameters:
  target - the character sequence to be replaced.
Parameters:
  replacement - the replacement sequence.
public  Textreplace(CharSet charSet, CharSequence replacement)
     Replaces the specified characters in this text with the specified replacement sequence.
Parameters:
  charSet - the set of characters to be replaced.
Parameters:
  replacement - the replacement sequence.
public  booleanstartsWith(CharSequence prefix)
     Indicates if this text starts with the specified prefix.
Parameters:
  prefix - the prefix.
public  booleanstartsWith(CharSequence prefix, int index)
     Indicates if this text starts with the specified prefix at the specified index.
Parameters:
  prefix - the prefix.
Parameters:
  index - the index of the prefix location in this string.
public  CharSequencesubSequence(int start, int end)
     Returns Text.subtext(int,int) subtext(start, end) .
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive.
public  Textsubtext(int start)
     Returns a portion of this text.
Parameters:
  start - the index of the first character inclusive.
public  Textsubtext(int start, int end)
     Returns a portion of this text.
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive.
public  TexttoLowerCase()
     Converts the characters of this text to lower case.
public  StringtoString()
     Returns the String representation of this text.
public  TexttoText()
     Returns this (implements javolution.lang.ValueType Realtime interface).
public  TexttoUpperCase()
     Converts the characters of this text to upper case.
public  Texttrim()
     Returns a copy of this text, with leading and trailing whitespace omitted.
public  TexttrimEnd()
     Returns a copy of this text, with trailing whitespace omitted.
public  TexttrimStart()
     Returns a copy of this text, with leading whitespace omitted.
public static  TextvalueOf(Object obj)
     Returns the text representing the specified object. If the object is an instance of Realtime then Realtime.toText is returned.
Parameters:
  obj - the object to represent as text.
public static  TextvalueOf(char[] chars)
     Returns the text that contains the characters from the specified array.
Parameters:
  chars - the array source of the characters.
public static  TextvalueOf(char[] chars, int offset, int length)
     Returns the text that contains the characters from the specified subarray of characters.
Parameters:
  chars - the source of the characters.
Parameters:
  offset - the index of the first character in the data soure.
Parameters:
  length - the length of the text returned.
static  TextvalueOf(TextBuilder tb, int start, int end)
     Converts a text builder to a text instance (optimization for TextBuilder.toText()).
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive.
public static  TextvalueOf(boolean b)
     Returns the text representation of the boolean argument.
Parameters:
  b - a boolean.
public static  TextvalueOf(char c)
     Returns the text instance corresponding to the specified character.
public static  TextvalueOf(int i)
     Returns the decimal representation of the specified int argument.
Parameters:
  i - the int to format.
public static  TextvalueOf(int i, int radix)
     Returns the radix representation of the specified int argument.
Parameters:
  i - the int to format.
Parameters:
  radix - the radix (e.g.
public static  TextvalueOf(long l)
     Returns the decimal representation of the specified long argument.
Parameters:
  l - the long to format.
public static  TextvalueOf(long l, int radix)
     Returns the radix representation of the specified long argument.
Parameters:
  l - the long to format.
Parameters:
  radix - the radix (e.g.
public static  TextvalueOf(char c, int length)
     Returns the text that contains a specific length sequence of the character specified.
Parameters:
  c - the character to fill this text with.
Parameters:
  length - the length of the text returned.

Field Detail
EMPTY
final public static Text EMPTY(Code)
Holds an empty character sequence.




Constructor Detail
Text
public Text(String str)(Code)
Creates a text holding the characters from the specified String .
Parameters:
  str - the string holding the character content.




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



compareTo
public int compareTo(Object csq)(Code)
Compares this text to another character sequence or string lexicographically.
Parameters:
  csq - the character sequence to be compared. TypeFormat.LEXICAL_COMPARATOR.compare(this, csq)
throws:
  ClassCastException - if the specifed object is not aCharSequence or a String.



concat
public Text concat(Text that)(Code)
Concatenates the specified text to the end of this text. This method is very fast (faster even than StringBuffer.append(String)) and still returns a text instance with an internal binary tree of minimal depth!
Parameters:
  that - the text that is concatenated. this + that



contentEquals
public boolean contentEquals(CharSequence csq)(Code)
Indicates if this text has the same character content as the specified character sequence.
Parameters:
  csq - the character sequence to compare with. true if the specified character sequence has the same character content as this text; false otherwise.



contentEqualsIgnoreCase
public boolean contentEqualsIgnoreCase(CharSequence csq)(Code)
Indicates if this text has the same character contend as the specified character sequence ignoring case considerations.
Parameters:
  csq - the CharSequence to compare this text against. true if the argument and this text are equal, ignoring case; false otherwise.



copy
public Object copy()(Code)



delete
public Text delete(int start, int end)(Code)
Returns the text without the characters between the specified indexes.
Parameters:
  start - the beginning index, inclusive.
Parameters:
  end - the ending index, exclusive. subtext(0, start).concat(subtext(end))
throws:
  IndexOutOfBoundsException - if (start < 0) || (end < 0) ||(start > end) || (end > this.length()



depth
public int depth()(Code)
Returns the depth of the internal tree used to represent this text. the maximum depth of the text internal binary tree.



endsWith
public boolean endsWith(CharSequence suffix)(Code)
Indicates if this text ends with the specified suffix.
Parameters:
  suffix - the suffix. true if the character sequence represented by theargument is a suffix of the character sequence represented bythis text; false otherwise.



equals
public boolean equals(Object obj)(Code)
Compares this text against the specified object for equality. Returns true if the specified object is a text having the same character sequence as this text. For generic comparaison with any character sequence the Text.contentEquals(CharSequence) should be used.
Parameters:
  obj - the object to compare with or null. true if that is a text with the same charactersequence as this text; false otherwise.



getChars
public void getChars(int start, int end, char dest, int destPos)(Code)
Copies the characters from this text into the destination character array.
Parameters:
  start - the index of the first character to copy.
Parameters:
  end - the index after the last character to copy.
Parameters:
  dest - the destination array.
Parameters:
  destPos - the start offset in the destination array.
throws:
  IndexOutOfBoundsException - if (start < 0) || (end < 0) ||(start > end) || (end > this.length())



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



indexOf
public int indexOf(CharSequence csq)(Code)
Returns the index within this text of the first occurrence of the specified character sequence searching forward.
Parameters:
  csq - a character sequence. the index of the first character of the character sequence found;or -1 if the character sequence is not found.



indexOf
public int indexOf(CharSequence csq, int fromIndex)(Code)
Returns the index within this text of the first occurrence of the specified characters sequence searching forward from the specified index.
Parameters:
  csq - a character sequence.
Parameters:
  fromIndex - the index to start the search from. the index in the range[fromIndex, length() - csq.length()] or -1 if the character sequence is not found.



indexOf
public int indexOf(char c, int fromIndex)(Code)
Returns the index within this text of the first occurrence of the specified character, starting the search at the specified index.
Parameters:
  c - the character to search for.
Parameters:
  fromIndex - the index to start the search from. the index of the first occurrence of the character in this textthat is greater than or equal to fromIndex, or -1 if the character does not occur.



indexOfAny
public int indexOfAny(CharSet charSet)(Code)
Returns the index within this text of the first occurrence of any character in the specified character set.
Parameters:
  charSet - the character set. the index of the first character that matches one of thecharacters in the supplied set; or -1 if none.



indexOfAny
public int indexOfAny(CharSet charSet, int start)(Code)
Returns the index within a region of this text of the first occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text. the index of the first character that matches one of thecharacters in the supplied set; or -1 if none.



indexOfAny
public int indexOfAny(CharSet charSet, int start, int length)(Code)
Returns the index within a region of this text of the first occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text.
Parameters:
  length - the length of the region to search. the index of the first character that matches one of thecharacters in the supplied array; or -1 if none.



insert
public Text insert(int index, Text txt)(Code)
Returns the text having the specified text inserted at the specified location.
Parameters:
  index - the insertion position.
Parameters:
  txt - the text being inserted. subtext(0, index).concat(txt).concat(subtext(index))
throws:
  IndexOutOfBoundsException - if (index < 0) ||(index > this.length())



intern
public static Text intern(CharSequence csq)(Code)
Returns a text equals to the specified character sequence from a pool of unique text instances in ImmortalMemory. an unique text instance allocated in ImmortalMemory.



intern
public static Text intern(String str)(Code)
Returns a text equals to the specified string from a pool of unique text instances in ImmortalMemory. an unique text instance allocated in ImmortalMemory.



isBlank
public boolean isBlank()(Code)
Indicates if all characters of this text are whitespaces (no characters greater than the space character). true if this text contains only whitespace.



isBlank
public boolean isBlank(int start, int length)(Code)
Indicates if the specified sub-range of characters of this text are whitespaces (no characters greater than the space character).
Parameters:
  start - the start index.
Parameters:
  length - the number of characters to inspect.



lastIndexOf
public int lastIndexOf(CharSequence csq)(Code)
Returns the index within this text of the last occurrence of the specified characters sequence searching backward.
Parameters:
  csq - a character sequence. the index of the first character of the character sequence found;or -1 if the character sequence is not found.



lastIndexOf
public int lastIndexOf(CharSequence csq, int fromIndex)(Code)
Returns the index within this text of the last occurrence of the specified character sequence searching backward from the specified index.
Parameters:
  csq - a character sequence.
Parameters:
  fromIndex - the index to start the backward search from. the index in the range [0, fromIndex] or-1 if the character sequence is not found.



lastIndexOf
public int lastIndexOf(char c, int fromIndex)(Code)
Returns the index within this text of the first occurrence of the specified character, searching backward and starting at the specified index.
Parameters:
  c - the character to search for.
Parameters:
  fromIndex - the index to start the search backward from. the index of the first occurrence of the character in this textthat is less than or equal to fromIndex, or -1 if the character does not occur.



lastIndexOfAny
public int lastIndexOfAny(CharSet charSet)(Code)
Returns the index within this text of the last occurrence of any character in the specified character set.
Parameters:
  charSet - the character set. the index of the last character that matches one of thecharacters in the supplied array; or -1 if none.



lastIndexOfAny
public int lastIndexOfAny(CharSet charSet, int start)(Code)
Returns the index within a region of this text of the last occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text. the index of the last character that matches one of thecharacters in the supplied array; or -1 if none.



lastIndexOfAny
public int lastIndexOfAny(CharSet charSet, int start, int length)(Code)
Returns the index within a region of this text of the last occurrence of any character in the specified character set.
Parameters:
  charSet - the character set.
Parameters:
  start - the index of the start of the search region in this text.
Parameters:
  length - the length of the region to search. the index of the last character that matches one of thecharacters in the supplied array; or -1 if none.



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



padLeft
public Text padLeft(int len)(Code)
Pads this text on the left with spaces to make the minimum total length as specified. The new length of the new text is equal to the original length plus (length()-len) spaces.
Parameters:
  len - the total number of characters to make this text equal to. a new text or the same text if no padding required.
throws:
  an - IllegalArgumentException if the (len<0).



padLeft
public Text padLeft(int len, char c)(Code)
Pads this text on the left to make the minimum total length as specified. Spaces or the given Unicode character are used to pad with.
The new length of the new text is equal to the original length plus (length()-len) pad characters.
Parameters:
  len - the total number of characters to make this text equal to.
Parameters:
  c - the character to pad using. a new text or the same text if no padding required.
throws:
  an - IllegalArgumentException if the (len<0).



padRight
public Text padRight(int len)(Code)
Pads this text on the right with spaces to make the minimum total length as specified. The new length of the new text is equal to the original length plus (length()-len) spaces.
Parameters:
  len - the total number of characters to make this text equal to. a new text or the same text if no padding required.
throws:
  an - IllegalArgumentException if the (len<0).



padRight
public Text padRight(int len, char c)(Code)
Pads this text on the right to make the minimum total length as specified. Spaces or the given Unicode character are used to pad with.
The new length of the new text is equal to the original length plus (length()-len) pad characters.
Parameters:
  len - the total number of characters to make this text equal to.
Parameters:
  c - the character to pad using. a new text or the same text if no padding required.
throws:
  an - IllegalArgumentException if the (len<0).



plus
public Text plus(Object obj)(Code)
Returns the concatenation of this text and the textual representation of the specified object.
Parameters:
  obj - the object whose textual representation is appended. this.concat(Text.valueOf(obj))



print
public void print()(Code)
Prints out this text to System.out (UTF-8 encoding). This method is equivalent to:[code] synchronized(OUT) { print(OUT); OUT.flush(); } ... static final OUT = new UTF8StreamWriter().setOutput(System.out); [/code]



print
public void print(Writer writer) throws IOException(Code)
Prints out this text to the specified writer.
Parameters:
  writer - the destination writer.



println
public void println()(Code)
Prints out this text to System.out and then terminates the line. This method is equivalent to:[code] synchronized(OUT) { println(OUT); OUT.flush(); } ... static final OUT = new UTF8StreamWriter().setOutput(System.out); [/code]



println
public void println(Writer writer) throws IOException(Code)
Prints out this text to the specified writer and then terminates the line.
Parameters:
  writer - the destination writer.



replace
public Text replace(CharSequence target, CharSequence replacement)(Code)
Replaces each character sequence of this text that matches the specified target sequence with the specified replacement sequence.
Parameters:
  target - the character sequence to be replaced.
Parameters:
  replacement - the replacement sequence. the resulting text.



replace
public Text replace(CharSet charSet, CharSequence replacement)(Code)
Replaces the specified characters in this text with the specified replacement sequence.
Parameters:
  charSet - the set of characters to be replaced.
Parameters:
  replacement - the replacement sequence. the resulting text.



startsWith
public boolean startsWith(CharSequence prefix)(Code)
Indicates if this text starts with the specified prefix.
Parameters:
  prefix - the prefix. true if the character sequence represented by theargument is a prefix of the character sequence represented bythis text; false otherwise.



startsWith
public boolean startsWith(CharSequence prefix, int index)(Code)
Indicates if this text starts with the specified prefix at the specified index.
Parameters:
  prefix - the prefix.
Parameters:
  index - the index of the prefix location in this string. this.substring(index).startsWith(prefix)



subSequence
public CharSequence subSequence(int start, int end)(Code)
Returns Text.subtext(int,int) subtext(start, end) .
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive. this.subtext(start, end)
throws:
  IndexOutOfBoundsException - if (start < 0) || (end < 0) ||(start > end) || (end > this.length())



subtext
public Text subtext(int start)(Code)
Returns a portion of this text.
Parameters:
  start - the index of the first character inclusive. the sub-text starting at the specified position.
throws:
  IndexOutOfBoundsException - if (start < 0) || (start > this.length())



subtext
public Text subtext(int start, int end)(Code)
Returns a portion of this text.
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive. the sub-text starting at the specified start position and ending just before the specified end position.
throws:
  IndexOutOfBoundsException - if (start < 0) || (end < 0) ||(start > end) || (end > this.length())



toLowerCase
public Text toLowerCase()(Code)
Converts the characters of this text to lower case. the text in lower case.
See Also:   Character.toLowerCase(char)
See Also:   



toString
public String toString()(Code)
Returns the String representation of this text. the java.lang.String for this text.



toText
public Text toText()(Code)
Returns this (implements javolution.lang.ValueType Realtime interface). this



toUpperCase
public Text toUpperCase()(Code)
Converts the characters of this text to upper case. the text in lower case.
See Also:   Character.toUpperCase(char)
See Also:   



trim
public Text trim()(Code)
Returns a copy of this text, with leading and trailing whitespace omitted. a copy of this text with leading and trailing whitespace removed, or this text if it has no leading ortrailing white space.



trimEnd
public Text trimEnd()(Code)
Returns a copy of this text, with trailing whitespace omitted. a copy of this text with trailing white space removed,or this text if it has no trailing white space.



trimStart
public Text trimStart()(Code)
Returns a copy of this text, with leading whitespace omitted. a copy of this text with leading white space removed,or this text if it has no leading white space.



valueOf
public static Text valueOf(Object obj)(Code)
Returns the text representing the specified object. If the object is an instance of Realtime then Realtime.toText is returned.
Parameters:
  obj - the object to represent as text. the textual representation of the specified object.



valueOf
public static Text valueOf(char[] chars)(Code)
Returns the text that contains the characters from the specified array.
Parameters:
  chars - the array source of the characters. the corresponding instance.



valueOf
public static Text valueOf(char[] chars, int offset, int length)(Code)
Returns the text that contains the characters from the specified subarray of characters.
Parameters:
  chars - the source of the characters.
Parameters:
  offset - the index of the first character in the data soure.
Parameters:
  length - the length of the text returned. the corresponding instance.
throws:
  IndexOutOfBoundsException - if (offset < 0) || (length < 0) || ((offset + length) > chars.length)



valueOf
static Text valueOf(TextBuilder tb, int start, int end)(Code)
Converts a text builder to a text instance (optimization for TextBuilder.toText()).
Parameters:
  start - the index of the first character inclusive.
Parameters:
  end - the index of the last character exclusive. the corresponding text instance.



valueOf
public static Text valueOf(boolean b)(Code)
Returns the text representation of the boolean argument.
Parameters:
  b - a boolean. if the argument is true, the text "true" is returned; otherwise, the text "false" is returned.



valueOf
public static Text valueOf(char c)(Code)
Returns the text instance corresponding to the specified character.
Parameters:
  c - a character. a text of length 1 containing 'c'.



valueOf
public static Text valueOf(int i)(Code)
Returns the decimal representation of the specified int argument.
Parameters:
  i - the int to format. the corresponding text instance.



valueOf
public static Text valueOf(int i, int radix)(Code)
Returns the radix representation of the specified int argument.
Parameters:
  i - the int to format.
Parameters:
  radix - the radix (e.g. 16 for hexadecimal). the corresponding text instance.



valueOf
public static Text valueOf(long l)(Code)
Returns the decimal representation of the specified long argument.
Parameters:
  l - the long to format. the corresponding text instance.



valueOf
public static Text valueOf(long l, int radix)(Code)
Returns the radix representation of the specified long argument.
Parameters:
  l - the long to format.
Parameters:
  radix - the radix (e.g. 16 for hexadecimal). the corresponding text instance.



valueOf
public static Text valueOf(char c, int length)(Code)
Returns the text that contains a specific length sequence of the character specified.
Parameters:
  c - the character to fill this text with.
Parameters:
  length - the length of the text returned. the corresponding instance.
throws:
  IndexOutOfBoundsException - if (length < 0)



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.