openlsd.common.datatype
Class LSDLinkedLongList<A>

java.lang.Object
  extended by openlsd.common.datatype.LSDLinkedLongList<A>
Type Parameters:
A - Class of object in LinkedList

public class LSDLinkedLongList<A>
extends java.lang.Object

Class to handle LinkedList with long capacity and not int capacity. Only minimal functions are done.

Author:
Frederic Bregier LGPL

Constructor Summary
LSDLinkedLongList()
          Create an empty LinkedLongList
 
Method Summary
 boolean add(A elt)
          Add the object in the end of the list
 boolean addFirst(A elt)
          Add the object in the beginning of the list
 boolean addLast(A elt)
          Add the object in the end of the list
 void clear()
          Remove all element from the list
 void destroy()
          Destroy the list
 A getFirst()
          Get the first element
 A getLast()
          Get the last element
 boolean isEmpty()
          Tell if the list is empty
 java.util.Iterator<A> iterator()
          Return the iterator for this list
 A peek()
          Get the first element
 A poll()
          Remove the first element
 A remove()
          Remove and return the first element
 A removeFirst()
          Remove and return the first element
 A removeLast()
          Remove and return the last element
 long size()
          return the size of the list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LSDLinkedLongList

public LSDLinkedLongList()
Create an empty LinkedLongList

Method Detail

size

public long size()
return the size of the list

Returns:
the size of the list

addLast

public boolean addLast(A elt)
Add the object in the end of the list

Parameters:
elt -
Returns:
True if OK, else False

add

public boolean add(A elt)
Add the object in the end of the list

Parameters:
elt -
Returns:
True if OK, else False

addFirst

public boolean addFirst(A elt)
Add the object in the beginning of the list

Parameters:
elt -
Returns:
True if OK, else False

getFirst

public A getFirst()
Get the first element

Returns:
the first element

peek

public A peek()
Get the first element

Returns:
the first element

getLast

public A getLast()
Get the last element

Returns:
the last element

poll

public A poll()
Remove the first element

Returns:
the first element

removeFirst

public A removeFirst()
Remove and return the first element

Returns:
the first element

remove

public A remove()
Remove and return the first element

Returns:
the first element

removeLast

public A removeLast()
Remove and return the last element

Returns:
the last element

clear

public void clear()
Remove all element from the list


destroy

public void destroy()
Destroy the list


isEmpty

public boolean isEmpty()
Tell if the list is empty

Returns:
True if empty, else False

iterator

public java.util.Iterator<A> iterator()
Return the iterator for this list

Returns:
the iterator for this list