Java Doc for BreakIterator.java in  » Apache-Harmony-Java-SE » java-package » java » 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 » Apache Harmony Java SE » java package » java.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.text.BreakIterator

All known Subclasses:   java.text.RuleBasedBreakIterator,
BreakIterator
abstract public class BreakIterator implements Cloneable(Code)
This class is used to locate the boundaries of text. Instance of this class can be got by some factory methods:
  • getCharacterInstance() returns a BreakIterator that iterate the logical characters without worrying about how the character is stored. For example, some character may be stored in more than one Unicode code point according to Unicode specification, this character can handle the logical characters with multi code points.
  • getWordInstance() returns a BreakIterator that iterate the word-breaks. The beginning and end of each word(including numbers) is treated as boundary position. Whitespace and punctuation are kept separate from real words.
  • getSentenceInstance() returns a BreakIterator that iterate the sentence-breaks.
  • getLineInstance() returns a BreakIterator that iterate the line-breaks which can be used to wrap lines. This iterator can handle whitespaces, hyphens and punctuations.
BreakIterator uses CharacterIterator to perform the analysis, so that any storage which provides CharacterIterator interface.
See Also:   CharacterIterator


Field Summary
final public static  intDONE
     This constant is returned by iterate methods like previous() or next() if they have returned all valid boundaries.
 com.ibm.icu.text.BreakIteratorwrapped
    

Constructor Summary
protected  BreakIterator()
     Default constructor, just for invocation by subclass.
 BreakIterator(com.ibm.icu.text.BreakIterator iterator)
    

Method Summary
public  Objectclone()
     Create copy of this iterator, all status including current position is kept.
abstract public  intcurrent()
     Return this iterator's current position.
abstract public  intfirst()
     Set this iterator's current position to the first boundary, and return this position.
abstract public  intfollowing(int offset)
     Set the position of the first boundary following the given offset, and return this position.
public static  Locale[]getAvailableLocales()
     Return all supported locales.
public static  BreakIteratorgetCharacterInstance()
     Return a new instance of BreakIterator used to iterate characters using default locale.
public static  BreakIteratorgetCharacterInstance(Locale where)
     Return a new instance of BreakIterator used to iterate characters using given locale.
protected static  intgetInt(byte[] buf, int offset)
     Get an int value from the given byte array, start from given offset.
public static  BreakIteratorgetLineInstance()
     Return a new instance of BreakIterator used to iterate line-breaks using default locale.
public static  BreakIteratorgetLineInstance(Locale where)
     Return a new instance of BreakIterator used to iterate line-breaks using given locale.
protected static  longgetLong(byte[] buf, int offset)
     Get a long value from the given byte array, start from given offset.
public static  BreakIteratorgetSentenceInstance()
     Return a new instance of BreakIterator used to iterate sentence-breaks using default locale.
public static  BreakIteratorgetSentenceInstance(Locale where)
     Return a new instance of BreakIterator used to iterate sentence-breaks using given locale.
protected static  shortgetShort(byte[] buf, int offset)
     Get a short value from the given byte array, start from given offset.
abstract public  CharacterIteratorgetText()
     Return a CharacterIterator which represents the text being analyzed.
public static  BreakIteratorgetWordInstance()
     Return a new instance of BreakIterator used to iterate word-breaks using default locale.
public static  BreakIteratorgetWordInstance(Locale where)
     Return a new instance of BreakIterator used to iterate word-breaks using given locale.
public  booleanisBoundary(int offset)
     Return true if the given offset is a boundary position.
abstract public  intlast()
     Set this iterator's current position to the last boundary, and return this position.
abstract public  intnext()
     Set this iterator's current position to the next boundary after current position, and return this position.
abstract public  intnext(int n)
     Set this iterator's current position to the next boundary after the given position, and return this position.
public  intpreceding(int offset)
     Return the position of last boundary precede the given offset, and set current position to returned value, or DONE if the given offset specifies the starting position.
abstract public  intprevious()
     Set this iterator's current position to the previous boundary before current position, and return this position.
public  voidsetText(String newText)
     Set the new text string to be analyzed, the current position will be reset to beginning of this new string, and the old string will lost.
abstract public  voidsetText(CharacterIterator newText)
     Set new text to be analyzed by given CharacterIterator.

Field Detail
DONE
final public static int DONE(Code)
This constant is returned by iterate methods like previous() or next() if they have returned all valid boundaries.



wrapped
com.ibm.icu.text.BreakIterator wrapped(Code)




Constructor Detail
BreakIterator
protected BreakIterator()(Code)
Default constructor, just for invocation by subclass.



BreakIterator
BreakIterator(com.ibm.icu.text.BreakIterator iterator)(Code)




Method Detail
clone
public Object clone()(Code)
Create copy of this iterator, all status including current position is kept. copy of this iterator



current
abstract public int current()(Code)
Return this iterator's current position. this iterator's current position



first
abstract public int first()(Code)
Set this iterator's current position to the first boundary, and return this position. the position of first boundary



following
abstract public int following(int offset)(Code)
Set the position of the first boundary following the given offset, and return this position. If there is no boundary after the given offset, return DONE.

IllegalArgumentException will be thrown if given offset is invalid.


Parameters:
  offset - the given position to be searched for the position of the first boundary following the given offset



getAvailableLocales
public static Locale[] getAvailableLocales()(Code)
Return all supported locales. all supported locales



getCharacterInstance
public static BreakIterator getCharacterInstance()(Code)
Return a new instance of BreakIterator used to iterate characters using default locale. a new instance of BreakIterator used to iterate characters usingdefault locale.



getCharacterInstance
public static BreakIterator getCharacterInstance(Locale where)(Code)
Return a new instance of BreakIterator used to iterate characters using given locale.
Parameters:
  where - the given locale a new instance of BreakIterator used to iterate characters usinggiven locale.



getInt
protected static int getInt(byte[] buf, int offset)(Code)
Get an int value from the given byte array, start from given offset.
Parameters:
  buf - the bytes to be converted
Parameters:
  offset - the start position of conversion the converted int value



getLineInstance
public static BreakIterator getLineInstance()(Code)
Return a new instance of BreakIterator used to iterate line-breaks using default locale. a new instance of BreakIterator used to iterate line-breaks usingdefault locale.



getLineInstance
public static BreakIterator getLineInstance(Locale where)(Code)
Return a new instance of BreakIterator used to iterate line-breaks using given locale.
Parameters:
  where - the given locale a new instance of BreakIterator used to iterate line-breaks usinggiven locale.



getLong
protected static long getLong(byte[] buf, int offset)(Code)
Get a long value from the given byte array, start from given offset.
Parameters:
  buf - the bytes to be converted
Parameters:
  offset - the start position of conversion the converted long value



getSentenceInstance
public static BreakIterator getSentenceInstance()(Code)
Return a new instance of BreakIterator used to iterate sentence-breaks using default locale. a new instance of BreakIterator used to iterate sentence-breaksusing default locale.



getSentenceInstance
public static BreakIterator getSentenceInstance(Locale where)(Code)
Return a new instance of BreakIterator used to iterate sentence-breaks using given locale.
Parameters:
  where - the given locale a new instance of BreakIterator used to iterate sentence-breaksusing given locale.



getShort
protected static short getShort(byte[] buf, int offset)(Code)
Get a short value from the given byte array, start from given offset.
Parameters:
  buf - the bytes to be converted
Parameters:
  offset - the start position of conversion the converted short value



getText
abstract public CharacterIterator getText()(Code)
Return a CharacterIterator which represents the text being analyzed. Please note that the returned value is probably the internal iterator used by this object, so that if the invoker want to modify the status of the returned iterator, a clone operation at first is recommended. a CharacterIterator which represents the textbeing analyzed.



getWordInstance
public static BreakIterator getWordInstance()(Code)
Return a new instance of BreakIterator used to iterate word-breaks using default locale. a new instance of BreakIterator used to iterate word-breaks usingdefault locale.



getWordInstance
public static BreakIterator getWordInstance(Locale where)(Code)
Return a new instance of BreakIterator used to iterate word-breaks using given locale.
Parameters:
  where - the given locale a new instance of BreakIterator used to iterate word-breaks usinggiven locale.



isBoundary
public boolean isBoundary(int offset)(Code)
Return true if the given offset is a boundary position. If this method returns true, the current iteration position is set to the given position; if the function returns false, the current iteration position is set as though following() had been called.
Parameters:
  offset - the given offset to check true if the given offset is a boundary position



last
abstract public int last()(Code)
Set this iterator's current position to the last boundary, and return this position. the position of last boundary



next
abstract public int next()(Code)
Set this iterator's current position to the next boundary after current position, and return this position. Return DONE if no boundary found after current position. the position of last boundary



next
abstract public int next(int n)(Code)
Set this iterator's current position to the next boundary after the given position, and return this position. Return DONE if no boundary found after the given position.
Parameters:
  n - the given position. the position of last boundary



preceding
public int preceding(int offset)(Code)
Return the position of last boundary precede the given offset, and set current position to returned value, or DONE if the given offset specifies the starting position.

IllegalArgumentException will be thrown if given offset is invalid.


Parameters:
  offset - the given start position to be searched for the position of last boundary precede the given offset



previous
abstract public int previous()(Code)
Set this iterator's current position to the previous boundary before current position, and return this position. Return DONE if no boundary found before current position. the position of last boundary



setText
public void setText(String newText)(Code)
Set the new text string to be analyzed, the current position will be reset to beginning of this new string, and the old string will lost.
Parameters:
  newText - the new text string to be analyzed



setText
abstract public void setText(CharacterIterator newText)(Code)
Set new text to be analyzed by given CharacterIterator. The position will be reset to the beginning of the new text, and other status of this iterator will be kept.
Parameters:
  newText - the given CharacterIterator refer to the textto be analyzed



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.