Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
Struct
org.gnu.glib.List
public class List
extends Struct
Constructor Summary | |
| |
|
Method Summary | |
void |
|
Handle |
|
void |
|
void |
|
Handle |
|
int |
|
Handle |
|
void |
|
Handle |
|
void |
|
void |
|
public List()
Construct a List object
public List(Handle handle)
Contruct a List object using a given handle. This constructor is used by the libraries internally to construct the object with the handle returned by a native method.
public void append(int data)
Append an element to the end of the list.
- Parameters:
data
- The handle of the object that is being added to the List.
public Handle first()
Return the first element from the List. This method will also reposition the current list item to the beginning of the list.
- Returns:
- The first element from the List.
public void free()
Release the resources associated with this object.
public void insert(int data, int position)
Insert an element at a specified location in the List.
- Parameters:
data
- The handle of the object that is being added to the List.position
- The position to perform the insertion.
public Handle last()
Return the last element from the List. This method will also reposition the current list item to the end of the list.
- Returns:
- The last element from the List.
public int length()
Return the number of elements contained in the List.
- Returns:
- The number of elements in the List.
public Handle next()
Return the next element in the List. This method will also move the current list item forward one element.
- Returns:
- The next element from the List.
public void prepend(int data)
Prepend an element to the end of the list.
- Parameters:
data
- The handle of the object that is being added to the List.
public Handle previous()
Return the previous element in the List. This method will also move the current list item backward one element.
- Returns:
- The previous element from the List.
public void remove(int data)
Remove the first instance of an element from the List.
- Parameters:
data
- The item to remove from the list. If two items contain the same data only the first will be removed.
public void removeAllInstances(int data)
Remove all instances of an element from the List.
- Parameters:
data
- The item to remove from the List. This method will remove all instances of the object pointed to by data.