public class YailList
extends java.lang.Object
Constructor and Description |
---|
YailList()
Create an empty YailList; ArrayList
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(java.lang.String anItem)
Appends an item to the end of the list
|
java.lang.String |
getItem(int index)
Returns the element at the specified position in this list.t
|
java.util.ArrayList<java.lang.String> |
getItems()
Returns all items in the YailList; ArrayList
|
java.lang.Object |
getObject(int index)
Return the Object at the given index.
|
java.lang.String |
getString(int index)
Return the String at the given index.
|
boolean |
isListEmpty()
Checks to see if the list is empty or not
|
static YailList |
makeEmptyList()
Create an empty YailList YailList from an array.
|
static YailList |
makeList(java.util.Collection vals)
Create a YailList from a Collection.
|
static YailList |
makeList(java.util.List vals)
Create a YailList from a List.
|
static YailList |
makeList(java.lang.Object[] objects)
Create a YailList from an array.
|
static YailList |
makeList(java.lang.Object[] objects,
int sortOrder)
Create a YailList from an array.
|
void |
removeItem(int index)
Removes the item at specified index from the list
|
void |
removeItem(java.lang.String item) |
void |
replaceValue(int position,
java.lang.String newValue)
This method replaces value at specified position with the newValue
|
void |
setItems(java.util.ArrayList<java.lang.String> items) |
int |
size()
Return the size of this list.
|
java.lang.Object[] |
toArray()
Return this YailList as an array.
|
java.lang.String |
toJSONString()
Return a strictly syntactically correct JSON text
representation of this YailList.
|
java.lang.String |
toString()
Return a String representation of this list.
|
java.lang.String[] |
toStringArray()
Return this YailList as an array of Strings.
|
static java.lang.String |
YailListElementToString(java.lang.Object element)
Convert a YailList element to a string.
|
public static YailList makeEmptyList()
public static YailList makeList(java.lang.Object[] objects)
public void replaceValue(int position, java.lang.String newValue)
position
- replaces item at specified position with a new itemnewValue
- public static YailList makeList(java.lang.Object[] objects, int sortOrder)
objects
- Array of StringsortOrder
- indicates sort order where:
public void addItem(java.lang.String anItem)
anItem
- String to append to the listpublic static YailList makeList(java.util.List vals)
public static YailList makeList(java.util.Collection vals)
vals
- public java.lang.Object[] toArray()
public java.lang.String[] toStringArray()
public static java.lang.String YailListElementToString(java.lang.Object element)
element
- public java.lang.String toJSONString()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getString(int index)
index
- Returns the item at specified locationpublic java.lang.Object getObject(int index)
public java.util.ArrayList<java.lang.String> getItems()
public java.lang.String getItem(int index)
index
- inedx of item; starts from 0public void setItems(java.util.ArrayList<java.lang.String> items)
public void removeItem(int index)
index
- index of the item to removepublic void removeItem(java.lang.String item)
public boolean isListEmpty()