public class StringArrayList extends Object implements Serializable
| Constructor and Description |
|---|
StringArrayList()
Creates a new empty List
|
StringArrayList(int size,
String[] data) |
StringArrayList(String[] data) |
StringArrayList(StringArrayList orig)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String str)
Adds a new element to the end of the List.
|
void |
addAll(StringArrayList vec)
Adds a whole List of elements.
|
String |
get(int idx)
Retrieves an element.
|
String |
getOrIndex(int idx) |
int |
indexOf(String str)
Lookup an element.
|
void |
remove(int idx) |
void |
set(int idx,
String str)
Replaces an element
|
int |
size()
Returns the number of elements.
|
List<String> |
toList() |
String |
toString()
Returns the string representation.
|
public StringArrayList(String[] data)
public StringArrayList(int size,
String[] data)
public StringArrayList()
public StringArrayList(StringArrayList orig)
orig - List that supplies the initial elements for
the new List.public void add(String str)
str - new elementpublic void addAll(StringArrayList vec)
vec - List of elements to addpublic int indexOf(String str)
str - element to findpublic String get(int idx)
idx - selects the element to getpublic String getOrIndex(int idx)
public void set(int idx,
String str)
idx - selects the element to be setstr - New value for the selected element; may be nullpublic void remove(int idx)
public int size()
Copyright © 1998–2017 1&1. All rights reserved.