Package org.basex.util.list
Class StringList
Resizable-array implementation for strings.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields inherited from class org.basex.util.list.ObjectList
listFields inherited from class org.basex.util.list.ElementList
factor, size -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.StringList(long capacity) Constructor with initial capacity.StringList(String... elements) Lightweight constructor, assigning the specified array. -
Method Summary
Modifier and TypeMethodDescriptionadd(byte[] element) Adds a token.protected final String[]newArray(int s) Creates a resized array.final StringListsort()Sorts the elements in ascending order, using the standard options.final StringListsort(boolean cs) Sorts the elements in ascending order.final StringListsort(boolean cs, boolean asc) Sorts the elements.final StringListsort(boolean cs, boolean ascending, int index) Sorts the elements.Methods inherited from class org.basex.util.list.ObjectList
add, add, add, addUnique, contains, equals, equals, finish, get, insert, iterator, next, peek, pop, push, remove, removeAll, removeAll, set, sort, toArray, toString, uniqueMethods inherited from class org.basex.util.list.ElementList
isEmpty, newCapacity, newCapacity, reset, size, sizeMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StringList
public StringList()Default constructor. -
StringList
public StringList(long capacity) Constructor with initial capacity.- Parameters:
capacity- array capacity
-
StringList
Lightweight constructor, assigning the specified array.- Parameters:
elements- initial array
-
-
Method Details
-
add
Adds a token.- Parameters:
element- element to be added- Returns:
- self reference
-
sort
Sorts the elements in ascending order, using the standard options.- Returns:
- self reference
-
sort
Sorts the elements in ascending order.- Parameters:
cs- respect case sensitivity- Returns:
- self reference
-
sort
Sorts the elements.- Parameters:
cs- respect case sensitivityasc- ascending/descending flag- Returns:
- self reference
-
sort
Sorts the elements.- Parameters:
cs- respect case sensitivityascending- ascending/descending orderindex- index of element from which sorting starts- Returns:
- self reference
-
newArray
Description copied from class:ObjectListCreates a resized array.- Specified by:
newArrayin classObjectList<String,StringList> - Parameters:
s- size- Returns:
- array
-