Java Doc for DynamicCharacterArray.java in  » 6.0-JDK-Modules » j2me » com » sun » midp » lcdui » 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 » 6.0 JDK Modules » j2me » com.sun.midp.lcdui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.midp.lcdui.DynamicCharacterArray

DynamicCharacterArray
public class DynamicCharacterArray (Code)
Similar to StringBuffer but does NOT resize when needed, only when requested


Field Summary
protected  charbuffer
     buffer to store data.
protected  intlength
    

Constructor Summary
public  DynamicCharacterArray(int capacity)
    
public  DynamicCharacterArray(String str)
    
public  DynamicCharacterArray(char[] data)
    
public  DynamicCharacterArray(char[] data, int capacity)
    

Method Summary
public  voidappend(char c)
     Appends a character onto the end of the buffer.
public  intcapacity()
    
public  charcharAt(int index)
    
public  voiddelete(int offset, int del_length)
    
public  voidget(char[] data)
     Returns the internal buffer in the array provided.
public  voidgetChars(int position, int get_length, char[] data, int offset)
     Returns the internal buffer in the array provided.
public  intinsert(char[] data, int offset, int ins_length, int position)
     Inserts an subset of an array into the buffer.
public  intinsert(int position, char ch)
     Inserts an character into the buffer.
public  intinsert(int position, String str)
     Inserts an String into the buffer.
public  intlength()
    
public  voidset(char[] data, int offset, int set_length)
     Sets the internal buffer to the values of the subset specified The offset parameter must be within the range [0..(size())], inclusive. The length parameter must be a non-negative integer such that (offset + length) <= size().
public  voidsetCapacity(int capacity)
     Sets the maximum capacity to the specified value.
public  voidsetCharAt(int index, char ch)
    
public  char[]toCharArray()
     Returns a copy of the active portion of the internal buffer.
public  StringtoString()
    

Field Detail
buffer
protected char buffer(Code)
buffer to store data. The capacity of this DynamicCharacterArray is equal to the length of this buffer



length
protected int length(Code)
the length of the array currently in use




Constructor Detail
DynamicCharacterArray
public DynamicCharacterArray(int capacity)(Code)
Initializes the DCA with a capacity and an empty array
Parameters:
  capacity - the maximum storage capacity
throws:
  IllegalArgumentException - if capacity <= 0
throws:
  IllegalArgumentException - if data.length > capacity



DynamicCharacterArray
public DynamicCharacterArray(String str)(Code)
Initializes the array with str and a capacity of str.length()
Parameters:
  str - initial array data, may NOT be null
throws:
  NullPointerException - if str is null



DynamicCharacterArray
public DynamicCharacterArray(char[] data)(Code)
Initializes the array with data and a capacity of data.length
Parameters:
  data - initial array data, may NOT be null
throws:
  NullPointerException - if data is null



DynamicCharacterArray
public DynamicCharacterArray(char[] data, int capacity)(Code)
Initializes the array with data and a capacity of capacity
Parameters:
  data - initial array data, may be null
Parameters:
  capacity - initial maximum capacity
throws:
  IllegalArgumentException - if capacity <= 0
throws:
  IllegalArgumentException - if data.length > capacity




Method Detail
append
public void append(char c)(Code)
Appends a character onto the end of the buffer.
Parameters:
  c - character to append
throws:
  IllegalArgumentException - if the resulting array would exceedthe capacity



capacity
public int capacity()(Code)
Returns the current capacity the maximum capacity



charAt
public char charAt(int index)(Code)
Returns the character at the specified index of the internal buffer
Parameters:
  index - index into the buffer the character at the specified index
throws:
  IndexOutOfBoundsException - if the 0 < index or index > length()



delete
public void delete(int offset, int del_length)(Code)
Deletes the specified range from the internal buffer
Parameters:
  offset - offset to begin deleting
Parameters:
  del_length - length of portion to delete
throws:
  StringIndexOutOfBoundsException - if offset and length donot specific a valid range in the internal buffer



get
public void get(char[] data)(Code)
Returns the internal buffer in the array provided. This must be at least length() long.
Parameters:
  data - array to fill with the character of the internal buffer
throws:
  IndexOutOfBoundsException - if data cannot hold the contents
throws:
  NullPointerException - if data is null



getChars
public void getChars(int position, int get_length, char[] data, int offset)(Code)
Returns the internal buffer in the array provided.
Parameters:
  position - index into the internal buffer to start copying
Parameters:
  get_length - length of region to copy
Parameters:
  data - array to fill with the character of the internal buffer
Parameters:
  offset - offset into data to copy to
throws:
  IndexOutOfBoundsException - if data cannot hold the contents
throws:
  NullPointerException - if data is null



insert
public int insert(char[] data, int offset, int ins_length, int position)(Code)
Inserts an subset of an array into the buffer. The offset parameter must be within the range [0..(size())], inclusive. The length parameter must be a non-negative integer such that (offset + length) <= size().
Parameters:
  data - array to insert
Parameters:
  offset - offset into data
Parameters:
  ins_length - length of subset
Parameters:
  position - index into the internal buffer to insert the subset the actual position the data was inserted
throws:
  ArrayIndexOutOfBoundsException - if offset and lengthspecify an invalid range
throws:
  IllegalArgumentException - if the resulting array would exceedthe capacity
throws:
  NullPointerException - if data is null



insert
public int insert(int position, char ch)(Code)
Inserts an character into the buffer.
Parameters:
  ch - character to insert
Parameters:
  position - index into the internal buffer to insert the subset the actual position the data was inserted
throws:
  IllegalArgumentException - if the resulting array would exceedthe capacity



insert
public int insert(int position, String str)(Code)
Inserts an String into the buffer.
Parameters:
  str - String to insert
Parameters:
  position - index into the internal buffer to insert the subset the actual position the data was inserted
throws:
  ArrayIndexOutOfBoundsException - if offset and lengthspecify an invalid range
throws:
  IllegalArgumentException - if the resulting array would exceedthe capacity
throws:
  NullPointerException - if data is null



length
public int length()(Code)
Returns the length of current data current length



set
public void set(char[] data, int offset, int set_length)(Code)
Sets the internal buffer to the values of the subset specified The offset parameter must be within the range [0..(size())], inclusive. The length parameter must be a non-negative integer such that (offset + length) <= size(). If data is null the buffer is emptied.
Parameters:
  data - the data to use to set the buffer
Parameters:
  offset - offset into data
Parameters:
  set_length - length of the subset
throws:
  ArrayIndexOutOfBoundsException - if offset and lengthspecify an invalid range
throws:
  IllegalArgumentException - if length exceeds the capacity



setCapacity
public void setCapacity(int capacity)(Code)
Sets the maximum capacity to the specified value. the buffer may be truncated if the new capacity is less than the current capacity.
Parameters:
  capacity - new maximum capacity
throws:
  IllegalArgumentException - is zero or less



setCharAt
public void setCharAt(int index, char ch)(Code)
Sets the character at index to ch
Parameters:
  index - index into the buffer
Parameters:
  ch - character to set to
throws:
  IndexOutOfBoundsException - if the 0 < index or index > length()



toCharArray
public char[] toCharArray()(Code)
Returns a copy of the active portion of the internal buffer. character array



toString
public String toString()(Code)
Return a String representation of the internal buffer a String object



Methods inherited from java.lang.Object
public boolean equals(Object obj)(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.