Java Doc for StringList.java in  » J2EE » wicket » org » apache » wicket » util » string » 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 » J2EE » wicket » org.apache.wicket.util.string 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.wicket.util.string.AbstractStringList
      org.apache.wicket.util.string.StringList

StringList
final public class StringList extends AbstractStringList (Code)
A typesafe, mutable list of strings supporting a variety of convenient operations as well as expected operations from List such as add(), size(), remove(), iterator(), get(int index) and toArray(). Instances of the class are not threadsafe.

StringList objects can be constructed empty or they can be created using any of several static factory methods:

  • valueOf(String[])
  • valueOf(String)
  • valueOf(Collection)
  • valueOf(Object[])
In the case of the Collection and Object[] factory methods, each Object in the collection or array is converted to a String via toString() before being added to the StringList.

The tokenize() factory methods allow easy creation of StringLists via StringTokenizer. The repeat() static factory method creates a StringList that repeats a given String a given number of times.

The prepend() method adds a String to the beginning of the StringList. The removeLast() method pops a String off the end of the list. The sort() method sorts strings in the List using Collections.sort(). The class also inherits useful methods from AbstractStringList that include join() methods ala Perl and a toString() method which joins the list of strings with comma separators for easy viewing.
author:
   Jonathan Locke




Constructor Summary
public  StringList()
     Constructor.
public  StringList(int size)
     Constructor.

Method Summary
public  voidadd(String string)
     Adds a string to the back of this list.
public  voidadd(int pos, String string)
     Adds the string to the stringlist at position pos.
public  voidadd(StringValue value)
     Adds a string value to this list as a string.
public  booleancontains(String string)
    
public  Stringget(int index)
     Gets the string at the given index.
public  ListgetList()
    
public  IStringIteratoriterator()
     Returns a typesafe iterator over this collection of strings.
public  voidprepend(String string)
     Adds the given string to the front of the list.
public  voidremove(int index)
     Removes the string at the given index.
public  voidremoveLast()
     Removes the last string in this list.
public static  StringListrepeat(int count, String string)
     Returns a list of a string repeated a given number of times.
public  intsize()
    
public  voidsort()
     Sorts this string list alphabetically.
public  String[]toArray()
     Converts this string list to a string array.
public static  StringListtokenize(String string)
     Extracts tokens from a comma and space delimited string.
public static  StringListtokenize(String string, String delimiters)
     Extracts tokens from a delimited string.
public  inttotalLength()
    
public static  StringListvalueOf(Collection collection)
     Converts a collection of objects into a list of string values by using the conversion methods of the StringValue class.
public static  StringListvalueOf(Object[] objects)
     Converts an array of objects into a list of strings by using the object to string conversion method of the StringValue class.
public static  StringListvalueOf(String string)
     Returns a string list with just one string in it.
public static  StringListvalueOf(String[] array)
     Converts a string array to a string list.


Constructor Detail
StringList
public StringList()(Code)
Constructor.



StringList
public StringList(int size)(Code)
Constructor.
Parameters:
  size - Number of elements to preallocate




Method Detail
add
public void add(String string)(Code)
Adds a string to the back of this list.
Parameters:
  string - String to add



add
public void add(int pos, String string)(Code)
Adds the string to the stringlist at position pos.
Parameters:
  pos - the position to add the string at
Parameters:
  string - the string to add.



add
public void add(StringValue value)(Code)
Adds a string value to this list as a string.
Parameters:
  value - The value to add



contains
public boolean contains(String string)(Code)

Parameters:
  string - The string to look for True if the list contains the string



get
public String get(int index)(Code)
Gets the string at the given index.
Parameters:
  index - The index The string at the index
throws:
  IndexOutOfBoundsException -



getList
public List getList()(Code)
List value (not a copy of this list)



iterator
public IStringIterator iterator()(Code)
Returns a typesafe iterator over this collection of strings. Typesafe string iterator



prepend
public void prepend(String string)(Code)
Adds the given string to the front of the list.
Parameters:
  string - The string to add



remove
public void remove(int index)(Code)
Removes the string at the given index.
Parameters:
  index - The index



removeLast
public void removeLast()(Code)
Removes the last string in this list.



repeat
public static StringList repeat(int count, String string)(Code)
Returns a list of a string repeated a given number of times.
Parameters:
  count - The number of times to repeat the string
Parameters:
  string - The string to repeat The list of strings



size
public int size()(Code)
The number of strings in this list.



sort
public void sort()(Code)
Sorts this string list alphabetically.



toArray
public String[] toArray()(Code)
Converts this string list to a string array. The string array



tokenize
public static StringList tokenize(String string)(Code)
Extracts tokens from a comma and space delimited string.
Parameters:
  string - The string The string tokens as a list



tokenize
public static StringList tokenize(String string, String delimiters)(Code)
Extracts tokens from a delimited string.
Parameters:
  string - The string
Parameters:
  delimiters - The delimiters The string tokens as a list



totalLength
public int totalLength()(Code)
The total length of all strings in this list.



valueOf
public static StringList valueOf(Collection collection)(Code)
Converts a collection of objects into a list of string values by using the conversion methods of the StringValue class.
Parameters:
  collection - The collection to add as strings The list



valueOf
public static StringList valueOf(Object[] objects)(Code)
Converts an array of objects into a list of strings by using the object to string conversion method of the StringValue class.
Parameters:
  objects - The objects to convert The list of strings



valueOf
public static StringList valueOf(String string)(Code)
Returns a string list with just one string in it.
Parameters:
  string - The string The list of one string



valueOf
public static StringList valueOf(String[] array)(Code)
Converts a string array to a string list.
Parameters:
  array - The array The list



Methods inherited from org.apache.wicket.util.string.AbstractStringList
abstract public String get(int index)(Code)(Java Doc)
abstract public IStringIterator iterator()(Code)(Java Doc)
final public String join()(Code)(Java Doc)
final public String join(String separator)(Code)(Java Doc)
final public String join(int first, int last, String separator)(Code)(Java Doc)
abstract public int size()(Code)(Java Doc)
public String[] toArray()(Code)(Java Doc)
final public List toList()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public int totalLength()(Code)(Java Doc)

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.