java.util

Class LinkedList<E>

Implemented Interfaces:
Cloneable, Collection<E>, Iterable<T>, List<E>, Queue<E>, Serializable
Known Direct Subclasses:
BucketingService.CollectedList

public class LinkedList<E>
extends AbstractSequentialList<E>
implements List<E>, Queue<E>, Cloneable, Serializable

Linked list implementation of the List interface. Implements all optional list operations, and permits all elements (including null). In addition to implementing the List interface, the LinkedList class provides uniformly named methods to get, remove and insert an element at the beginning and end of the list. These operations allow linked lists to be used as a stack, queue, or double-ended queue (deque).

The class implements the Queue interface, providing first-in-first-out queue operations for add, poll, etc. Other stack and deque operations could be easily recast in terms of the standard list operations. They're included here primarily for convenience, though they may run slightly faster than the equivalent List operations.

All of the operations perform as could be expected for a doubly-linked list. Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.

Note that this implementation is not synchronized. If multiple threads access a list concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list. If no such object exists, the list should be "wrapped" using the Collections.synchronizedList method. This is best done at creation time, to prevent accidental unsynchronized access to the list:

     List list = Collections.synchronizedList(new LinkedList(...));
 

The iterators returned by the this class's iterator and listIterator methods are fail-fast: if the list is structurally modified at any time after the iterator is created, in any way except through the Iterator's own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.

Note that the fail-fast behavior of an iterator cannot be guaranteed as it is, generally speaking, impossible to make any hard guarantees in the presence of unsynchronized concurrent modification. Fail-fast iterators throw ConcurrentModificationException on a best-effort basis. Therefore, it would be wrong to write a program that depended on this exception for its correctness: the fail-fast behavior of iterators should be used only to detect bugs.

This class is a member of the ../../../guide/collections/index.html"> Java Collections Framework.

Since:
1.2
See Also:
List, ArrayList, Vector, Collections.synchronizedList(List), Serialized Form

Field Summary

Fields inherited from class java.util.AbstractList<E>

modCount

Constructor Summary

LinkedList()
Constructs an empty list.
LinkedList(E> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.

Method Summary

T[] toArray(T[] a)
Returns an array containing all of the elements in this list in the correct order; the runtime type of the returned array is that of the specified array.
boolean
add(E o)
Appends the specified element to the end of this list.
void
add(int index, E element)
Inserts the specified element at the specified position in this list.
boolean
addAll(E> c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator.
boolean
addAll(int index, E> c)
Inserts all of the elements in the specified collection into this list, starting at the specified position.
void
addFirst(E o)
Inserts the given element at the beginning of this list.
void
addLast(E o)
Appends the given element to the end of this list.
void
clear()
Removes all of the elements from this list.
Object
clone()
Returns a shallow copy of this LinkedList.
boolean
contains(Object o)
Returns true if this list contains the specified element.
E
element()
Retrieves, but does not remove, the head (first element) of this list.
E
get(int index)
Returns the element at the specified position in this list.
E
getFirst()
Returns the first element in this list.
E
getLast()
Returns the last element in this list.
int
indexOf(Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if the List does not contain this element.
int
lastIndexOf(Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.
ListIterator
listIterator(int index)
Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
boolean
offer(E o)
Adds the specified element as the tail (last element) of this list.
E
peek()
Retrieves, but does not remove, the head (first element) of this list.
E
poll()
Retrieves and removes the head (first element) of this list.
E
remove()
Retrieves and removes the head (first element) of this list.
E
remove(int index)
Removes the element at the specified position in this list.
boolean
remove(Object o)
Removes the first occurrence of the specified element in this list.
E
removeFirst()
Removes and returns the first element from this list.
E
removeLast()
Removes and returns the last element from this list.
E
set(int index, E element)
Replaces the element at the specified position in this list with the specified element.
int
size()
Returns the number of elements in this list.
Object[]
toArray()
Returns an array containing all of the elements in this list in the correct order.

Methods inherited from class java.util.AbstractSequentialList<E>

add, addAll, get, iterator, listIterator, remove, set

Methods inherited from class java.util.AbstractList<E>

add, add, addAll, clear, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList

Methods inherited from class java.util.AbstractCollection<E>

T[] toArray, add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

LinkedList

public LinkedList()
Constructs an empty list.
Usages and Demos :

View More Examples of LinkedList()
   1:       System.out.println("time for LinkedList = " +
   2:          timeList(new LinkedList()));
   3: 
   4:       System.out.println("time for ArrayList = " +
   5:          timeList(new ArrayList()));

View Full Code Here
   1:     public SysPageMapping(Table sysSysTable) {
   2:         super(CatalogHelper.SYS_PAGE_MAPPING_TABLE_NAME, new LinkedList());
   3:         
   4:         this.loadFirstPage(sysSysTable);
   5:         

View Full Code Here
   1:     public SysTable(Table sysSysTable) {
   2:         super(CatalogHelper.SYS_TABLE_TABLE_NAME, new LinkedList());
   3:         
   4:         this.loadFirstPage(sysSysTable);
   5:         

View Full Code Here
   1:     public Iterator getColumns() {
   2:         return (new LinkedList()).iterator();
   3:     }
   4:         ...
   5:     public Iterator getPages() {
   6:         return (new LinkedList()).iterator();
   7:     }
   8: 
   9:     public void insertRegister(EncodeableRegister register) {

View Full Code Here
   1:     public SysColumn(Table sysSysTable) {
   2:         super(CatalogHelper.SYS_COLUMN_TABLE_NAME, new LinkedList());
   3:         
   4:         this.loadFirstPage(sysSysTable);
   5:         

View Full Code Here

LinkedList

public LinkedList(E> c)
Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Parameters:
c - the collection whose elements are to be placed into this list.
Throws:
NullPointerException - if the specified collection is null.
Usages and Demos :

View More Examples of LinkedList(E> c)
   1:         {
   2:             List payload = new LinkedList((List) message.getPayload());
   3:             payloadContext.set(payload);
   4: 
   5:             if (enableCorrelation != ENABLE_CORRELATION_NEVER)

View Full Code Here
   1:                 } catch (InstantiationException e) {
   2:                     retCol=new LinkedList((Collection) obj);
   3:                 } catch (IllegalAccessException e) {
   4:         ...
   5:                     retCol=new LinkedList((Collection) obj);
   6:                 }
   7:         ...
   8:                 } catch (InstantiationException e) {
   9:                     retCol=new LinkedList((Collection) wrapper);
  10:                 } catch (IllegalAccessException e) {

View Full Code Here
   1:                         else 
   2:                             toSave.put(k, new LinkedList((List)v));
   3:                     }
   4:                     else {
   5:                         if(LOG.isWarnEnabled())

View Full Code Here
   1:                 (ComponentDefinition)super.clone();
   2:             if (_props != null) compdef._props = new LinkedList(_props);
   3:             if (_molds != null) compdef._molds = new HashMap(_molds);
   4:             if (_params != null) compdef._params = new HashMap(_params);
   5:             return compdef;

View Full Code Here
   1:      if(getVariableModMap().containsKey(sym)){
   2:          curResMasses = new LinkedList((List) getVariableModMap().get(sym));
   3:      }else{
   4:          curResMasses = new LinkedList();
   5:      }

View Full Code Here

Method Details

T[] toArray

public  T[] toArray(T[] a)
Returns an array containing all of the elements in this list in the correct order; the runtime type of the returned array is that of the specified array. If the list fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this list.

If the list fits in the specified array with room to spare (i.e., the array has more elements than the list), the element in the array immediately following the end of the collection is set to null. This is useful in determining the length of the list only if the caller knows that the list does not contain any null elements.

Specified by:
T[] toArray in interface List<E>
T[] toArray in interface Collection<E>
Overrides:
T[] toArray in interface AbstractCollection<E>
Parameters:
a - the array into which the elements of the list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
Returns:
an array containing the elements of the list.
Throws:
ArrayStoreException - if the runtime type of a is not a supertype of the runtime type of every element in this list.
NullPointerException - if the specified array is null.

add

public boolean add(E o)
Appends the specified element to the end of this list.
Specified by:
add in interface List<E>
add in interface Collection<E>
Overrides:
add in interface AbstractList<E>
Parameters:
o - element to be appended to this list.
Returns:
true (as per the general contract of Collection.add).
Usages and Demos :

View More Examples of add(E o)
   1: import java.io.StringReader;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     LinkedList compileString(String value) throws InvalidVariableException {
   7:         StringReader reader = new StringReader(value);
   8:         ...
   9:         LinkedList result = new LinkedList();
  10:         StringBuffer buffer = new StringBuffer();
  11:         ...
  12:                     if (buffer.length() > 0) {
  13:                         result.add(buffer.toString());

View Full Code Here
   1:        } else {
   2:      LinkedList optionLabels = new LinkedList();
   3:         ...
   4:      LinkedList optionComponents = new LinkedList();
   5:      if (coDO.Fields != null) {
   6:         ...
   7:           }
   8:           optionLabels.add(iSoDO.Name);
   9:           optionComponents.add(new SimpleOptionDisplay(iSoDO,iSosDO));
  10:         ...
  11:        if (coDO.ComplexOptionType.equals(ComplexOptionTypeEnum.CHOICE)) {
  12:           optionLabels.add("CHOICE...");

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.Set;
   4:         ...
   5:    {
   6:       LinkedList stack = new LinkedList();
   7:         ...
   8:       stack.add("");
   9:       StringBuffer buffer = new StringBuffer();
  10:         ...
  11:                       append(indent).append("   ").append(CONTEXT).append(" ").append(context).append(" = (").append(CONTEXT).append(")").append(iterator).append(".next();\n");
  12:                stack.add(name);

View Full Code Here
   1:         for (int i = 0; i < topCities.length; i++) {
   2:             comparator.add(topCities[i]);
   3:         }
   4:         ...
   5:         String[] keys = (String[]) topCities.clone();
   6:         List topCitiesForTest = new LinkedList(Arrays.asList(topCities));
   7:         FixedOrderComparator comparator = new FixedOrderComparator(topCitiesForTest);
   8:         ...
   9:         try {
  10:             comparator.add("Minneapolis");
  11:             fail("Should have thrown an UnsupportedOperationException");
  12:         ...
  13:         assertEquals(FixedOrderComparator.UNKNOWN_BEFORE, comparator.getUnknownObjectBehavior());
  14:         LinkedList keys = new LinkedList(Arrays.asList(topCities));

View Full Code Here
   1: import java.util.Comparator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:         for (int i = 0; i < topCities.length; i++) {
   6:             comparator.add(topCities[i]);
   7:         }
   8:         ...
   9:         String[] keys = (String[]) topCities.clone();
  10:         List topCitiesForTest = new LinkedList(Arrays.asList(topCities));
  11:         FixedOrderComparator comparator = new FixedOrderComparator(topCitiesForTest);
  12:         ...
  13:         try {
  14:             comparator.add("Minneapolis");

View Full Code Here

add

public void add(int index,
                E element)
Inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
Specified by:
add in interface List<E>
Overrides:
add in interface AbstractSequentialList<E>
Parameters:
index - index at which the specified element is to be inserted.
element - element to be inserted.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).
Usages and Demos :

View More Examples of add(int index,E element)
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:         {
   6:             LinkedList folderPath = new LinkedList();
   7:         ...
   8:             folderPath.add(0, parentFolder);
   9:             FolderData parent = parentFolder.getParent();
  10:         ...
  11:             {
  12:                 folderPath.add(0, parent);

View Full Code Here
   1: import java.awt.image.WritableRaster;
   2: import java.util.LinkedList;
   3: import java.util.HashMap;
   4:         ...
   5:     private static WeakHashMap gradientCache = new WeakHashMap();
   6:         private static LinkedList recentInfos = new LinkedList();
   7: 
   8:         ...
   9:                 recentInfos.remove( info );
  10:                 recentInfos.add( 0, info );
  11:                 if ( recentInfos.size() > 16 ) recentInfos.removeLast();

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.TreeSet;
   4:         ...
   5:         {
   6:             LinkedList catPath = new LinkedList();
   7:         ...
   8:             catPath.add(0, cat);
   9:             WeblogCategoryData parent = cat.getParent();
  10:         ...
  11:             {
  12:                 catPath.add(0, parent);

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: import java.util.WeakHashMap;
   4:         ...
   5:     private static WeakHashMap gradientCache = new WeakHashMap();
   6:     private static LinkedList recentInfos = new LinkedList();
   7: 
   8:         ...
   9:         recentInfos.remove(info);
  10:         recentInfos.add(0, info);
  11:         if (recentInfos.size() > 16) recentInfos.removeLast();

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: import java.util.WeakHashMap;
   4:         ...
   5:     private static WeakHashMap gradientCache = new WeakHashMap();
   6:     private static LinkedList recentInfos = new LinkedList();
   7: 
   8:         ...
   9:         recentInfos.remove(info);
  10:         recentInfos.add(0, info);
  11:         if (recentInfos.size() > 16)

View Full Code Here

addAll

public boolean addAll(E> c)
Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified Collection is this list, and this list is nonempty.)
Specified by:
addAll in interface List<E>
addAll in interface Collection<E>
Overrides:
addAll in interface AbstractCollection<E>
Parameters:
c - the elements to be inserted into this list.
Returns:
true if this list changed as a result of the call.
Throws:
NullPointerException - if the specified collection is null.
Usages and Demos :

View More Examples of addAll(E> c)
   1: import com.ibm.icu.text.MessageFormat;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:         super(connection);
   6:         fOutgoingPackets = new LinkedList();
   7:     }
   8:         ...
   9:     private void sendAvailablePackets() throws InterruptedException, IOException {
  10:         LinkedList packetsToSend = new LinkedList();
  11:         synchronized (fOutgoingPackets) {
  12:         ...
  13:                 fOutgoingPackets.wait();
  14:             packetsToSend.addAll(fOutgoingPackets);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     protected Collection collectFunctionCallDeclarations(AbstractObjectTreeNode node) {
   6:         LinkedList calls = new LinkedList();
   7:         
   8:         ...
   9:         while (e.hasMoreElements())
  10:             calls.addAll(collectFunctionCallDeclarations((AbstractObjectTreeNode) e.nextElement()));
  11:         
  12:         ...
  13:         
  14:         declarationLists.addAll(getUserFeatureFunctionDeclarationLists());

View Full Code Here
   1: import java.util.Arrays;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     private String name;
   6:     private LinkedList args = null;
   7: 
   8:         ...
   9:         if(args == null)
  10:             args = new LinkedList();
  11:         args.add(arg);
  12:         ...
  13:             args.clear();
  14:         args.addAll(Arrays.asList(argList));

View Full Code Here
   1: import java.util.List;
   2: import java.util.LinkedList;
   3: import java.util.Map;
   4:         ...
   5:             if( targetBundle != null ) {
   6:                 LinkedList bundles = new LinkedList();
   7:                 bundles.addFirst(targetBundle);
   8:         ...
   9:                 if( (app != null) && !absoluteLink ) {
  10:                     bundles.addAll(app.getBundleDescriptors());
  11:                 }

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.Properties;
   4:         ...
   5:         Connection connection = null;
   6:         Collection membersCollection = new LinkedList();
   7:         try {
   8:         ...
   9:         Connection connection = null;
  10:         Collection groupsCollection = new LinkedList();
  11:         try {
  12:         ...
  13:         for (Iterator i = principalNames.iterator(); i.hasNext();) {
  14:             list.addAll(getMembers((String) i.next()));

View Full Code Here

addAll

public boolean addAll(int index,
                      E> c)
Inserts all of the elements in the specified collection into this list, starting at the specified position. Shifts the element currently at that position (if any) and any subsequent elements to the right (increases their indices). The new elements will appear in the list in the order that they are returned by the specified collection's iterator.
Specified by:
addAll in interface List<E>
Overrides:
addAll in interface AbstractSequentialList<E>
Parameters:
index - index at which to insert first element from the specified collection.
c - elements to be inserted into this list.
Returns:
true if this list changed as a result of the call.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index > size()).
NullPointerException - if the specified collection is null.
Usages and Demos :

View More Examples of addAll(int index,E> c)
   1: import java.util.LinkedHashSet;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5: 
   6:         LinkedList locationStack = new LinkedList(urls);
   7:         try {
   8:         ...
   9:                 List manifestClassPath = getManifestClassPath(resourceLocation);
  10:                 locationStack.addAll(0, manifestClassPath);
  11:             }

View Full Code Here
   1: import java.util.LinkedHashMap;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:     protected void addURLs(List urls) {
   6:         LinkedList locationStack = new LinkedList(urls);
   7:         try {
   8:         ...
   9:                         }
  10:                         locationStack.addAll(0, classPathUrls);
  11:                     }

View Full Code Here
   1:             dce.setElement(elem);
   2:             List dclList = new LinkedList(docChangeListeners);
   3:             for (Iterator iter = dclList.iterator(); iter.hasNext();) {
   4:         ...
   5:     private void notifyDocumentChangeListeners(int eventType) {
   6:         Iterator i = new LinkedList(docChangeListeners).iterator();
   7:         
   8:         ...
   9:     private List getElementsOfType(Class type, List modelElements) {
  10:         LinkedList result = new LinkedList();
  11:         if (modelElements == null) return Collections.unmodifiableList(result);
  12:         ...
  13:                 if (osm != null) {
  14:                     result.addAll(getElementsOfType(type, osm.getAllModelElements()));

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:         final ArrayList files = new ArrayList();
   6:         final LinkedList argList = new LinkedList();
   7:         argList.addAll(Arrays.asList(args));
   8:         ...
   9:                 argList.remove(i);
  10:                 argList.addAll(i, aliases);
  11:                 i--;

View Full Code Here

addFirst

public void addFirst(E o)
Inserts the given element at the beginning of this list.
Parameters:
o - the element to be inserted at the beginning of this list.
Usages and Demos :

View More Examples of addFirst(E o)
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     private LinkedList agents = new LinkedList();
   7: 
   8:         ...
   9:         agent.start();
  10:         agents.addFirst(agent);
  11:     }

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     private LinkedList agents = new LinkedList();
   7: 
   8:         ...
   9:         agent.start();
  10:         agents.addFirst(agent);
  11:     }

View Full Code Here
   1:   public static void testZretezenehoSeznamu() {
   2:     LinkedList ll = new LinkedList();
   3:     fill(ll);
   4:         ...
   5:     System.out.println(ll);
   6:     ll.addFirst("jeden");
   7:         ...
   8:     ll.addFirst("dva");
   9:     System.out.println(ll);
  10:         ...
  11:   public static void main(String[] args) {
  12:     zakladniTest(fill(new LinkedList()));

View Full Code Here
   1:   public static void testLinkedList() {
   2:     LinkedList ll = new LinkedList();
   3:     Collection1.fill(ll, 5);
   4:         ...
   5:     print(ll);
   6:     ll.addFirst("one");
   7:         ...
   8:     ll.addFirst("two");
   9:     print(ll);
  10:         ...
  11:   public static void main(String args[]) {
  12:     basicTest(fill(new LinkedList()));

View Full Code Here
   1:     }
   2:     private LinkedList _argumentBindings = new LinkedList();
   3:     private final Map _equalMap = new HashMap();
   4:         ...
   5:     public void clearArgumentBindings() {
   6:         _argumentBindings=new LinkedList();
   7:     }
   8:         ...
   9: 
  10:         _argumentBindings.addFirst(argumentBindings);
  11:     }

View Full Code Here

addLast

public void addLast(E o)
Appends the given element to the end of this list. (Identical in function to the add method; included only for consistency.)
Parameters:
o - the element to be inserted at the end of this list.
Usages and Demos :

View More Examples of addLast(E o)
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: public class BreadthFirstTraversal extends SourceGraphTraversal {
   6:     private LinkedList m_active;
   7: 
   8:         ...
   9:     protected void walk() {
  10:         m_active = new LinkedList();
  11:         m_active.add(getSource());
  12:         ...
  13:                 if (!getWalker().isVisited(adjacent)) {
  14:                     m_active.addLast(adjacent);

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.StringTokenizer;
   4:         ...
   5: 
   6:   protected LinkedList _categoryElements = new LinkedList();
   7: 
   8:         ...
   9:   public void addCategoryElement(CategoryElement categoryElement) {
  10:     _categoryElements.addLast(categoryElement);
  11:   }

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     private LinkedList buffers;
   7: 
   8:         ...
   9:         if (buffers == null) {
  10:             buffers = new LinkedList();
  11:         }
  12:         ...
  13: 
  14:         buffers.addLast(buffer);

View Full Code Here
   1: 
   2:   private LinkedList queue;
   3: 
   4:         ...
   5:     this.path = path;
   6:     queue = new LinkedList();
   7:     Parameters p = environment.getParameters();
   8:         ...
   9: 
  10:   public LinkedList getQueue() {
  11:     return queue;
  12:         ...
  13:     } else {
  14:       queue.addLast(buf);

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     private ForumMessage cm = null;
   6:     private LinkedList stack = new LinkedList();
   7:     private int message_num = 0;
   8:         ...
   9:         wd.setMessage(tw,cm);
  10:         stack.addLast((Object)wd);
  11:         
  12:         ...
  13:             nw.setMessage(tw,next);
  14:             stack.addLast((Object)nw);

View Full Code Here

clear

public void clear()
Removes all of the elements from this list.
Specified by:
clear in interface List<E>
clear in interface Collection<E>
Overrides:
clear in interface AbstractList<E>
Usages and Demos :

View More Examples of clear()
   1: import java.util.List;
   2: import java.util.LinkedList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:   protected LinkedList d_list = null;
   7:   
   8:         ...
   9:     super(src, parent);
  10:     d_list = new LinkedList();
  11:   }
  12:         ...
  13:   public void clear() {
  14:     d_list.clear();

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     
   6:     private LinkedList m_list = new LinkedList();
   7:     private HashMap    m_map  = new HashMap();
   8:         ...
   9:     public void clear() {
  10:         m_list.clear();
  11:         ...
  12:         m_map.clear();

View Full Code Here
   1: 
   2:     LinkedList l=gp2.getList();
   3:         ...
   4:     l.clear();
   5:     gp2.printListCount();
   6:         ...
   7: 
   8:     l=new LinkedList();
   9:     l.add(new String(""));
  10:         ...
  11:     gp2.setList(l);
  12:     l.clear();

View Full Code Here
   1: import java.io.Serializable;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     private String profname;
   6:     private LinkedList exams;
   7:     private int numExams;
   8:         ...
   9:         profname = new String();
  10:         exams = new LinkedList();
  11:         ...
  12:         exams.clear();

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:     private String _name = null;
   6:     private LinkedList _commands = null;
   7: 
   8:         ...
   9:     public ChainConfig() {
  10:         _commands = new LinkedList();
  11:     }
  12:         ...
  13:     public void setCommands(List commands) {
  14:         _commands.clear();

View Full Code Here

clone

public Object clone()
Returns a shallow copy of this LinkedList. (The elements themselves are not cloned.)
Overrides:
clone in interface Object
Returns:
a shallow copy of this LinkedList instance.
Usages and Demos :

View More Examples of clone()
   1: public abstract class AbstractListenerMulticaster implements EventListener, Serializable {
   2:     private LinkedList _listener = new LinkedList();
   3: 
   4:         ...
   5:         } else if (eventListener instanceof AbstractListenerMulticaster) {
   6:             LinkedList listenerList = getListenerList(eventListener);
   7: 
   8:         ...
   9:     protected Iterator getListeners() {
  10:         return ((List)_listener.clone()).iterator();
  11:     }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Iterator;
   4:         ...
   5:     }
   6:     protected LinkedList tracks = new LinkedList();
   7:     public Iterator iterator() 
   8:         ...
   9:     {
  10:         LinkedList old = (LinkedList)tracks.clone();
  11:         tracks.add(r);
  12:         ...
  13:     {
  14:         LinkedList old = (LinkedList)tracks.clone();

View Full Code Here
   1: import java.util.Collections;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5: {
   6:     private final LinkedList linkedList_;
   7: 
   8:         ...
   9: 
  10:         linkedList_ = new LinkedList();
  11:     }
  12:         ...
  13:     {
  14:         final List _sorted = (List) linkedList_.clone();

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     protected LinkedList selections = new LinkedList();
   7:     public SelectionModel() 
   8:         ...
   9:             {
  10:                 old = (LinkedList)selections.clone();
  11:                 selections.add(obj);
  12:         ...
  13:             {
  14:                 old = (LinkedList)selections.clone();

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: {
   6:   private LinkedList list;
   7: 
   8:         ...
   9:     table = new HashMap();
  10:     list = new LinkedList();
  11:     setLimit(limit);
  12:         ...
  13:   {
  14:     final KeyedQueue q = (KeyedQueue) super.clone();

View Full Code Here

contains

public boolean contains(Object o)
Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)).
Specified by:
contains in interface List<E>
contains in interface Collection<E>
Overrides:
contains in interface AbstractCollection<E>
Parameters:
o - element whose presence in this list is to be tested.
Returns:
true if this list contains the specified element.
Usages and Demos :

View More Examples of contains(Object o)
   1: 
   2:     private LinkedList targets=null;
   3: 
   4:         ...
   5:     super(name,cl,owner);
   6:     targets=new LinkedList();
   7:     }
   8:         ...
   9:     public final boolean isConnectedTo(ConnectableImportStructure imS) {
  10:     return(targets.contains(imS));
  11:     }
  12:         ...
  13:     protected final void removeAllTargets() {
  14:     targets=new LinkedList();

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5: 
   6:     protected LinkedList edges       = new LinkedList();
   7: 
   8:         ...
   9:     public boolean contains(IEdge e) {
  10:         return edges.contains(e);
  11:     }
  12:         ...
  13:     public boolean contains(INode n) {
  14:         return nodes.contains(n);

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     protected LinkedList selections = new LinkedList();
   7:     public SelectionModel() 
   8:         ...
   9:     {
  10:         return selections.contains(obj);
  11:     }
  12:         ...
  13:         {
  14:             if (!selections.contains(obj)) 

View Full Code Here
   1:     String name=EEGAnalysis.getText("unnamedPiece");
   2:     LinkedList descriptors=new LinkedList();
   3:     ReportMontage majorMontage;
   4:         ...
   5:     public final boolean remove(ReportDescriptor descr) {
   6:     if(descriptors.contains(descr)) return(descriptors.remove(descr));
   7:     return(false);
   8:         ...
   9:     public final boolean contains(ReportDescriptor descr) {
  10:     return(descriptors.contains(descr));
  11:     }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:   private LinkedList cmd_;
   7:   private int nbMaxCommand_ = BuPreferences.BU.getIntegerProperty("undo.cmd.nb", 15);
   8:         ...
   9:   public boolean containsCmd(CtuluCommand _c){
  10:     return cmd_.contains(_c);
  11:   }
  12:         ...
  13:     if (cmd_ == null) {
  14:       cmd_ = new LinkedList();

View Full Code Here

element

public E element()
Retrieves, but does not remove, the head (first element) of this list.
Specified by:
element in interface Queue<E>
Returns:
the head of this queue.
Throws:
NoSuchElementException - if this queue is empty.
Since:
1.5

get

public E get(int index)
Returns the element at the specified position in this list.
Specified by:
get in interface List<E>
Overrides:
get in interface AbstractSequentialList<E>
Parameters:
index - index of element to return.
Returns:
the element at the specified position in this list.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).
Usages and Demos :

View More Examples of get(int index)
   1: package de.uniwue.ki.mas.sim.analysis;
   2: import java.util.LinkedList;
   3: public final class BoundedStack {
   4:         ...
   5:     private final int _windowSize;
   6:     private final LinkedList _array;
   7: 
   8:         ...
   9: public BoundedStack(int windowSize) {
  10:     this(new LinkedList(), windowSize);
  11: }
  12:         ...
  13: public synchronized Object get(int index) {
  14:     return _array.get(index);

View Full Code Here
   1: import java.awt.Component;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:   private LinkedList messages = new LinkedList();
   7:   
   8:         ...
   9:       case PROBLEM_COLUMN:  {
  10:         return messages.get(row);
  11:       }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Stack;
   4:         ...
   5: 
   6:         LinkedList list = ((KilimTraceTreeNode) aParent).getChildren();
   7:         if (list == null || list == KILIM.EMPTY_LIST) {
   8:         ...
   9:         }
  10:         return list.get(index);
  11:     }
  12:         ...
  13: 
  14:         LinkedList list = ((KilimTraceTreeNode) aParent).getChildren();

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Map;
   4:         ...
   5:             separator = localeString.indexOf('_') >= 0 ? '_' : ',';
   6:         LinkedList list = new LinkedList();
   7:         CollectionsX.parse(list, localeString, separator);
   8:         ...
   9:             assert(list.size() <= 3);
  10:             var = (String)list.get(2);
  11:         case 2:
  12:         ...
  13:             cnt = (String)list.get(1);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:     
   6:     protected LinkedList _context = new LinkedList();
   7: 
   8:         ...
   9:         if (index < 0 || index >= _context.size()) return null;
  10:         return _context.get(_context.size() - index - 1);
  11:     }

View Full Code Here

getFirst

public E getFirst()
Returns the first element in this list.
Returns:
the first element in this list.
Throws:
NoSuchElementException - if this list is empty.
Usages and Demos :

View More Examples of getFirst()
   1: public class StackL {
   2:   private LinkedList seznam = new LinkedList();
   3:   public void vlozit(Object v) {
   4:         ...
   5:   }
   6:   public Object nahore() { return seznam.getFirst(); }
   7:   public Object vyjmout() { 
   8:     return seznam.removeFirst(); 
   9:   }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:         protected Object initialValue() {
   6:             return new LinkedList();
   7:         }
   8:         ...
   9:         }
  10:         ((LinkedList) threadLocal.get()).addFirst(value);
  11:     }
  12:         ...
  13:         }
  14:         return linkedList.getFirst();

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: import java.util.Collection;
   4:         ...
   5: 
   6:   private LinkedList list = new LinkedList();
   7:   
   8:         ...
   9:   public CacheEntry firstCacheEntry() {
  10:     return list.isEmpty() ? null : (CacheEntry) list.getFirst();
  11:   }

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: import java.util.Collection;
   4:         ...
   5: 
   6:   private LinkedList list = new LinkedList();
   7:   
   8:         ...
   9:   public CacheEntry firstCacheEntry() {
  10:     return list.isEmpty() ? null : (CacheEntry) list.getFirst();
  11:   }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     ) {
   6:         LinkedList targetList = getPathList(target);
   7:         ...
   8:         LinkedList relativeList = getPathList(realativeTo);
   9: 
  10:         ...
  11:             !targetList.isEmpty() && !relativeList.isEmpty() &&
  12:                 targetList.getFirst().equals(relativeList.getFirst())

View Full Code Here

getLast

public E getLast()
Returns the last element in this list.
Returns:
the last element in this list.
Throws:
NoSuchElementException - if this list is empty.
Usages and Demos :

View More Examples of getLast()
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     LinkedList list = new LinkedList();
   7:     
   8:         ...
   9:         
  10:         return list.getLast();
  11:     }

View Full Code Here
   1: import java.util.EmptyStackException;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: {
   6:     private final LinkedList elements = new LinkedList();
   7: 
   8:         ...
   9: 
  10:         return elements.getLast();
  11:     }

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: import java.util.Map;
   4:         ...
   5:     public Object get() {
   6:         LinkedList list = listThreadLocal.getList();
   7:         if (list.isEmpty()) {
   8:         ...
   9:         }
  10:         return list.getLast();
  11:     }
  12:         ...
  13:     public Object pop() {
  14:         LinkedList list = listThreadLocal.getList();

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.Set;
   4:         ...
   5:             
   6:             LinkedList providedList = new LinkedList( provided );
   7:             LinkedList acceptedList = new LinkedList( accepted );
   8:         ...
   9:             
  10:             if ( vc.compare( acceptedList.getFirst() , providedList.getLast() ) > 0 ) {
  11:         ...
  12:                 version = (String) providedList.getLast();

View Full Code Here
   1:    private TreeModel _model;
   2:    private LinkedList _selectedPath;
   3:    private boolean _customTrigger = false;
   4:         ...
   5: 
   6:    private LinkedList startPath()
   7:    {
   8:         ...
   9:       LinkedList startPath = new LinkedList();
  10:       startPath.add(_model.getRoot());
  11:         ...
  12:    {
  13:       Object parent = path.getLast();

View Full Code Here

indexOf

public int indexOf(Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if the List does not contain this element. More formally, returns the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Specified by:
indexOf in interface List<E>
Overrides:
indexOf in interface AbstractList<E>
Parameters:
o - element to search for.
Returns:
the index in this list of the first occurrence of the specified element, or -1 if the list does not contain this element.
Usages and Demos :

View More Examples of indexOf(Object o)
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.Map;
   4:         ...
   5: 
   6:     private LinkedList keySequence;
   7: 
   8:         ...
   9:     {
  10:         keySequence = new LinkedList();
  11:     }
  12:         ...
  13:     {
  14:         return keySequence.indexOf(key);

View Full Code Here
   1: 
   2:       LinkedList listOfWeeks = new LinkedList();
   3:       Week       lastWeek = null;
   4:         ...
   5:          Rental r                = (Rental) rentals.get(x);
   6:          int    week_index       = listOfWeeks.indexOf(r.getWeek());
   7:         ...
   8:          int    lighthouse_index = lighthouses.indexOf(r.getLighthouse());

View Full Code Here
   1:         }
   2:         protected void dirLookahead(String arg, LinkedList argList, int nextArgIndex) {
   3:             unparsedArgs.add(arg);
   4:             ConfigParser.Arg next = (ConfigParser.Arg) argList.get(nextArgIndex);
   5:             String value = next.getValue();

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.Map;
   4:         ...
   5:              Priority priority = (Priority) iter.next();
   6:              LinkedList list = (LinkedList) get(priority);
   7:              found = list.contains(value);
   8:         ...
   9:                 if (list.contains(obj)) 
  10:                     returnObj = list.remove(list.indexOf(obj));
  11:             }
  12:         ...
  13:             if (list.contains(obj)) 
  14:                 returnObj = list.remove(list.indexOf(obj));

View Full Code Here

lastIndexOf

public int lastIndexOf(Object o)
Returns the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element. More formally, returns the highest index i such that (o==null ? get(i)==null : o.equals(get(i))), or -1 if there is no such index.
Specified by:
lastIndexOf in interface List<E>
Overrides:
lastIndexOf in interface AbstractList<E>
Parameters:
o - element to search for.
Returns:
the index in this list of the last occurrence of the specified element, or -1 if the list does not contain this element.
Usages and Demos :

View More Examples of lastIndexOf(Object o)
   1: import java.util.EmptyStackException;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: {
   6:     private final LinkedList elements = new LinkedList();
   7: 
   8:         ...
   9:         {
  10:             result = elements.size() - elements.lastIndexOf(value);
  11:         }

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.Map;
   4:         ...
   5: 
   6:     private LinkedList keySequence;
   7: 
   8:         ...
   9:     {
  10:         keySequence = new LinkedList();
  11:     }
  12:         ...
  13:     {
  14:         return keySequence.lastIndexOf(key);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:     private static HashMap cacheByOID;
   6:     private static LinkedList cacheLRUList;
   7:     private static HashMap cacheByPath;
   8:         ...
   9:             cacheByOID = new HashMap();
  10:             cacheLRUList = new LinkedList();
  11:             cacheByPath = new HashMap();
  12:         ...
  13:                 {
  14:                     int removeIndex = cacheLRUList.lastIndexOf(entry);

View Full Code Here

listIterator

public ListIterator listIterator(int index)
Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list. Obeys the general contract of List.listIterator(int).

The list-iterator is fail-fast: if the list is structurally modified at any time after the Iterator is created, in any way except through the list-iterator's own remove or add methods, the list-iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.

Specified by:
listIterator in interface List<E>
Overrides:
listIterator in interface AbstractSequentialList<E>
Parameters:
index - index of first element to be returned from the list-iterator (by a call to next).
Returns:
a ListIterator of the elements in this list (in proper sequence), starting at the specified position in the list.
Throws:
IndexOutOfBoundsException - if index is out of range (index < 0 || index > size()).
Usages and Demos :

View More Examples of listIterator(int index)
   1: import java.util.ArrayList;
   2: import java.util.LinkedList;
   3: import java.util.ListIterator;
   4:         ...
   5:   private final PoolWorker[] threads;
   6:   private final LinkedList queue;
   7:   private static ImageLoadManager instance = null;
   8:         ...
   9:     this.nThreads = nThreads;
  10:     queue = new LinkedList();
  11:     threads = new PoolWorker[nThreads];
  12:         ...
  13:           r = (ImageViewTableModel.LoadImage) queue.removeFirst();
  14:           ListIterator iter = queue.listIterator(0);

View Full Code Here
   1: import java.util.ArrayList;
   2: import java.util.LinkedList;
   3: import java.util.ListIterator;
   4:         ...
   5:   private final PoolWorker[] threads;
   6:   private final LinkedList queue;
   7:   private static ImageLoadManager instance = null;
   8:         ...
   9:     this.nThreads = nThreads;
  10:     queue = new LinkedList();
  11:     threads = new PoolWorker[nThreads];
  12:         ...
  13:           r = (ImageViewTableModel.LoadImage) queue.removeFirst();
  14:           ListIterator iter = queue.listIterator(0);

View Full Code Here
   1: import java.util.ArrayList;
   2: import java.util.LinkedList;
   3: import java.util.ListIterator;
   4:         ...
   5:   private final PoolWorker[] threads;
   6:   private final LinkedList queue;
   7:   private static ImageLoadManager instance = null;
   8:         ...
   9:     this.nThreads = nThreads;
  10:     queue = new LinkedList();
  11:     threads = new PoolWorker[nThreads];
  12:         ...
  13:           r = (ImageViewTableModel.LoadImage) queue.removeFirst();
  14:           ListIterator iter = queue.listIterator(0);

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.ListIterator;
   4:         ...
   5: 
   6:     protected LinkedList list    = null;
   7: 
   8:         ...
   9: 
  10:     LinkedList listeners = null;
  11: 
  12:         ...
  13:     public synchronized void initialize(JComboBox combo) {
  14:     ListIterator iterator = list.listIterator(0);

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.ListIterator;
   4:         ...
   5: 
   6:    private LinkedList queueList = null;
   7: 
   8:         ...
   9:    {
  10:       return queueList.listIterator(index);
  11:    }

View Full Code Here

offer

public boolean offer(E o)
Adds the specified element as the tail (last element) of this list.
Specified by:
offer in interface Queue<E>
Parameters:
o - the element to add.
Returns:
true (as per the general contract of Queue.offer)
Since:
1.5

peek

public E peek()
Retrieves, but does not remove, the head (first element) of this list.
Specified by:
peek in interface Queue<E>
Returns:
the head of this queue, or null if this queue is empty.
Since:
1.5

poll

public E poll()
Retrieves and removes the head (first element) of this list.
Specified by:
poll in interface Queue<E>
Returns:
the head of this queue, or null if this queue is empty.
Since:
1.5

remove

public E remove()
Retrieves and removes the head (first element) of this list.
Specified by:
remove in interface Queue<E>
Returns:
the head of this queue.
Throws:
NoSuchElementException - if this queue is empty.
Since:
1.5
Usages and Demos :

View More Examples of remove()
   1: 
   2: import java.util.LinkedList;
   3: import java.util.NoSuchElementException;
   4:         ...
   5: 
   6:     LinkedList list = new LinkedList();
   7: 
   8:         ...
   9:     public void testRemove() throws Exception {
  10:         assertEquals("a", list.remove());
  11:         assertEquals("b", list.getFirst());
  12:         ...
  13:         try {
  14:             list.remove();

View Full Code Here
   1: import java.util.Hashtable;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     public static synchronized void returnConnection(EndPoint end, Streams client) {
   6:         LinkedList q = (LinkedList) connections_.get(end);
   7:         if(q == null) {
   8:         ...
   9:                     }
  10:                 ret = (Streams) q.remove();
  11:         

View Full Code Here
   1:             {
   2:                 iterator.remove();
   3:             }
   4:         ...
   5:                     event.process(this);
   6:                     events.remove();
   7:                 }
   8:         ...
   9: 
  10:         private LinkedList events = new LinkedList();

View Full Code Here

remove

public E remove(int index)
Removes the element at the specified position in this list. Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.
Specified by:
remove in interface List<E>
Overrides:
remove in interface AbstractSequentialList<E>
Parameters:
index - the index of the element to removed.
Returns:
the element previously at the specified position.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).
Usages and Demos :

View More Examples of remove(int index)
   1: {
   2:     private LinkedList allConnections;
   3: 
   4:         ...
   5:     {
   6:         allConnections = new LinkedList();
   7:     }
   8:         ...
   9:     {
  10:         allConnections.remove(ci);
  11:     }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     private LinkedList theStatGenerators = new LinkedList();
   7: 
   8:         ...
   9:     public synchronized void remove(StatGenerator aStat) {
  10:         theStatGenerators.remove(aStat);
  11:     }

View Full Code Here
   1: 
   2:     private LinkedList targets=null;
   3: 
   4:         ...
   5:     super(name,cl,owner);
   6:     targets=new LinkedList();
   7:     }
   8:         ...
   9:     protected final void removeTarget(ConnectableImportStructure cis) {
  10:     targets.remove(cis);
  11:     }
  12:         ...
  13:     protected final void removeAllTargets() {
  14:     targets=new LinkedList();

View Full Code Here
   1: import java.awt.event.KeyEvent;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     private LinkedList messages = new LinkedList();
   7: 
   8:         ...
   9:         if (messages.size() >= screen.getHeight() / FONT_SIZE) {
  10:             messages.remove(0);
  11:         }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.ArrayList;
   4:         ...
   5:     private ArrayList theSwitches = new ArrayList();
   6:     private LinkedList theListeners = new LinkedList();
   7: 
   8:         ...
   9:             if (theListeners.contains(aListener))
  10:                 theListeners.remove(aListener);
  11:         }
  12:         ...
  13:             if (myPos != -1) {
  14:                 theSwitches.remove(myPos);

View Full Code Here

remove

public boolean remove(Object o)
Removes the first occurrence of the specified element in this list. If the list does not contain the element, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists).
Specified by:
remove in interface List<E>
remove in interface Collection<E>
Overrides:
remove in interface AbstractCollection<E>
Parameters:
o - element to be removed from this list, if present.
Returns:
true if the list contained the specified element.
Usages and Demos :

View More Examples of remove(Object o)
   1: {
   2:     private LinkedList allConnections;
   3: 
   4:         ...
   5:     {
   6:         allConnections = new LinkedList();
   7:     }
   8:         ...
   9:     {
  10:         allConnections.remove(ci);
  11:     }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.Iterator;
   4:         ...
   5: 
   6:     private LinkedList theStatGenerators = new LinkedList();
   7: 
   8:         ...
   9:     public synchronized void remove(StatGenerator aStat) {
  10:         theStatGenerators.remove(aStat);
  11:     }

View Full Code Here
   1: 
   2:     private LinkedList targets=null;
   3: 
   4:         ...
   5:     super(name,cl,owner);
   6:     targets=new LinkedList();
   7:     }
   8:         ...
   9:     protected final void removeTarget(ConnectableImportStructure cis) {
  10:     targets.remove(cis);
  11:     }
  12:         ...
  13:     protected final void removeAllTargets() {
  14:     targets=new LinkedList();

View Full Code Here
   1: import java.awt.event.KeyEvent;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     private LinkedList messages = new LinkedList();
   7: 
   8:         ...
   9:         if (messages.size() >= screen.getHeight() / FONT_SIZE) {
  10:             messages.remove(0);
  11:         }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.ArrayList;
   4:         ...
   5:     private ArrayList theSwitches = new ArrayList();
   6:     private LinkedList theListeners = new LinkedList();
   7: 
   8:         ...
   9:             if (theListeners.contains(aListener))
  10:                 theListeners.remove(aListener);
  11:         }
  12:         ...
  13:             if (myPos != -1) {
  14:                 theSwitches.remove(myPos);

View Full Code Here

removeFirst

public E removeFirst()
Removes and returns the first element from this list.
Returns:
the first element from this list.
Throws:
NoSuchElementException - if this list is empty.
Usages and Demos :

View More Examples of removeFirst()
   1: public class StackL {
   2:   private LinkedList seznam = new LinkedList();
   3:   public void vlozit(Object v) {
   4:         ...
   5:   public Object vyjmout() { 
   6:     return seznam.removeFirst(); 
   7:   }
   8:   public static void main(String[] args) {
   9:     StackL zasobnik = new StackL();

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     private final LinkedList list = new LinkedList();
   7:     private boolean closed = false;
   8:         ...
   9:         }
  10:         return list.removeFirst();
  11:     }

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     
   6:     private LinkedList m_list = new LinkedList();
   7:     private HashMap    m_map  = new HashMap();
   8:         ...
   9:     public Object removeFirst() {
  10:         return m_list.removeFirst();
  11:     }

View Full Code Here
   1: public class ConnectionList {
   2:     private LinkedList list = new LinkedList();
   3:     private Selector selectorToNotify;
   4:         ...
   5:         
   6:         return list.removeFirst();
   7:     }
   8: }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     public SimpleQueue() {
   6:         q = new LinkedList();
   7:     }
   8:         ...
   9:     public Object remove() {
  10:         return q.removeFirst();
  11:     }
  12:         ...
  13: 
  14:     private LinkedList q = null;

View Full Code Here

removeLast

public E removeLast()
Removes and returns the last element from this list.
Returns:
the last element from this list.
Throws:
NoSuchElementException - if this list is empty.
Usages and Demos :

View More Examples of removeLast()
   1: package de.uniwue.ki.mas.sim.analysis;
   2: import java.util.LinkedList;
   3: public final class BoundedStack {
   4:         ...
   5:     private final int _windowSize;
   6:     private final LinkedList _array;
   7: 
   8:         ...
   9: public BoundedStack(int windowSize) {
  10:     this(new LinkedList(), windowSize);
  11: }
  12:         ...
  13:     if ((_windowSize > 0) && (size() > _windowSize)) {
  14:         _array.removeLast();

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: 
   6:     LinkedList list = new LinkedList();
   7:     
   8:         ...
   9:         
  10:         return list.removeLast();
  11:     }

View Full Code Here
   1: import java.util.HashMap;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5:     
   6:     private LinkedList m_list = new LinkedList();
   7:     private HashMap    m_map  = new HashMap();
   8:         ...
   9:     public Object removeLast() {
  10:         return m_list.removeLast();
  11:     }

View Full Code Here
   1: 
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5: public class WeblogQueue {
   6:   private LinkedList queue;
   7:   private int size;
   8:         ...
   9:     this.size = size;
  10:     queue = new LinkedList();
  11:   }
  12:         ...
  13:     if (queue.size() == size) {
  14:       queue.removeLast();

View Full Code Here
   1: import java.util.EmptyStackException;
   2: import java.util.LinkedList;
   3: 
   4:         ...
   5: {
   6:     private final LinkedList elements = new LinkedList();
   7: 
   8:         ...
   9: 
  10:         return elements.removeLast();
  11:     }

View Full Code Here

set

public E set(int index,
             E element)
Replaces the element at the specified position in this list with the specified element.
Specified by:
set in interface List<E>
Overrides:
set in interface AbstractSequentialList<E>
Parameters:
index - index of element to replace.
element - element to be stored at the specified position.
Returns:
the element previously at the specified position.
Throws:
IndexOutOfBoundsException - if the specified index is out of range (index < 0 || index >= size()).
Usages and Demos :

View More Examples of set(int index,E element)
   1:     height = MainWindow.HEIGHT/2;
   2:     maps = new LinkedList();
   3:     setBackground(Color.white);
   4:         ...
   5:   public MainWindow getMW() { return mw; }
   6:   public synchronized LinkedList getMaps() { return maps; }
   7:   public abstract void addMap(JPanel map);
   8:         ...
   9:   
  10:   public synchronized void setMaps(LinkedList maps) { this.maps = maps; }
  11:   public synchronized void clearMaps() { maps.clear(); }
  12:         ...
  13:     JPanel temp2 = (JPanel)maps.get(b);
  14:     maps.set(a, temp2);

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:     protected ListContainer container;
   6:     protected LinkedList testList;
   7:     protected static final int COUNT=10;
   8:         ...
   9:         int index=0;
  10:         testList.set(index,testObj);
  11:         ...
  12:         container.set(index,testObj);

View Full Code Here
   1: import java.sql.SQLException;
   2: import java.util.LinkedList;
   3: import edu.utah.uonline.objects.ConnectionBean;
   4:         ...
   5:             + " ORDER BY users.l_name");
   6:     LinkedList studentsList = new LinkedList();
   7:     StringBuffer sb2 = new StringBuffer();
   8:         ...
   9:           lame.setRegisteredForExam(true);
  10:           studentsList.set(i, lame);
  11:           break;

View Full Code Here
   1:             if (set.getType() == rtype) {
   2:                 list.set(i, rrset);
   3:                 return;
   4:         ...
   5:         else {
   6:             LinkedList list = new LinkedList();
   7:             list.add(set);
   8:             list.add(rrset);
   9:             data.put(name, list);

View Full Code Here
   1:             if (elt.getType() == type) {
   2:                 list.set(i, element);
   3:                 return;
   4:         ...
   5:         else {
   6:             LinkedList list = new LinkedList();
   7:             list.add(elt);
   8:             list.add(element);
   9:             data.put(name, list);

View Full Code Here

size

public int size()
Returns the number of elements in this list.
Specified by:
size in interface List<E>
size in interface Collection<E>
Overrides:
size in interface AbstractCollection<E>
Returns:
the number of elements in this list.
Usages and Demos :

View More Examples of size()
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import ostore.network.NetworkMessage;
   4:         ...
   5:     public BigInteger peer_guid;
   6:     public LinkedList neighbors;
   7: 
   8:         ...
   9:     public RoutingTableResp (NodeId dest, BigInteger g, LinkedList n) {
  10:     super (dest, false);
  11:         ...
  12:         else if (count > 16) {
  13:             System.err.println ("Got RoutingTableResp with neighbors.size()"

View Full Code Here
   1:     private boolean running;
   2:     private LinkedList clients;
   3:     private ByteBuffer readBuffer;
   4:         ...
   5:     public ChatterServer() {
   6:     clients = new LinkedList();
   7:     readBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE);
   8:         ...
   9:         sendMessage(clientChannel, "\n\nWelcome to ChatterBox, there are " + 
  10:                 clients.size() + " users online.\n");
  11:         sendMessage(clientChannel, "Type 'quit' to exit.\n");

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:     
   6:     protected LinkedList _context = new LinkedList();
   7: 
   8:         ...
   9:     public Object currentContext(){
  10:         return _context.size()>0 ? _context.getLast() : null;
  11:     }
  12:         ...
  13:     {
  14:         if (index < 0 || index >= _context.size()) return null;

View Full Code Here
   1: import java.util.Iterator;
   2: import java.util.LinkedList;
   3: import java.util.NoSuchElementException;
   4:         ...
   5: 
   6:     final LinkedList l=new LinkedList();
   7: 
   8:         ...
   9: 
  10:             while(l.size() == 0) {
  11:                 if(closed)
  12:         ...
  13: 
  14:             if(l.size() == 0) {

View Full Code Here
   1: 
   2:     private LinkedList mQueue = new LinkedList();
   3:     private int mThreadCount;
   4:         ...
   5: 
   6:     private Collection mListeners = new LinkedList();
   7:     private Collection mExceptionListeners = new LinkedList();
   8:         ...
   9:         int queueSize;
  10:         if ((queueSize = mQueue.size()) >= mMaxSize) {
  11:         ...
  12:             if (mListeners.size() > 0) {

View Full Code Here

toArray

public Object[] toArray()
Returns an array containing all of the elements in this list in the correct order.
Specified by:
toArray in interface List<E>
toArray in interface Collection<E>
Overrides:
toArray in interface AbstractCollection<E>
Returns:
an array containing all of the elements in this list in the correct order.
Usages and Demos :

View More Examples of toArray()
   1: 
   2:     boolean showDialog(WignerPlot client,LinkedList styles) {
   3: 
   4:         ...
   5:     list.setListData(styles.toArray());
   6:     
   7:     Point p=client.getLocation();
   8:     Dimension d=client.getSize();

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.LinkedList;
   3: import java.util.Vector;
   4:         ...
   5:     public void fireTreeNodesChanged(TreeNode changed) {
   6:         LinkedList list = new LinkedList();
   7:         for (TreeNode i = changed; i != null; i = i.getParent()) {    
   8:         ...
   9:         }
  10:         TreeModelEvent event = new TreeModelEvent(changed, list.toArray());        
  11: 
  12:         ...
  13: 
  14:         TreeModelEvent event = new TreeModelEvent(changed, list.toArray(), 

View Full Code Here
   1: import java.util.Enumeration;
   2: import java.util.LinkedList;
   3: import java.util.Vector;
   4:         ...
   5: 
   6:         LinkedList list = new LinkedList();
   7:         for (TreeNode i = changed; i != null; i = i.getParent()) {    
   8:         ...
   9: 
  10:         final TreeModelEvent event = new TreeModelEvent(changed, list.toArray());        
  11: 
  12:         ...
  13: 
  14:         final TreeModelEvent event = new TreeModelEvent(changed, list.toArray(), 

View Full Code Here
   1:             remoteDeliveryEntityRemote rdeh2 = rdeh.findByPrimaryKey(pk);
   2:             LinkedList queue = rdeh2.getQueue();
   3:             rdeh.remove(pk);
   4:         ...
   5: 
   6:             Object[] obj = queue.toArray();
   7:             numQueue = obj.length;
   8:         ...
   9:             remoteDeliveryEntityRemote rdr2 = rdh.findByPrimaryKey(pk);
  10:             LinkedList queue = rdr2.getQueue();
  11:             rdh.remove(pk);
  12:         ...
  13:             this.obj = queue.toArray();

View Full Code Here
   1: import java.util.LinkedHashSet;
   2: import java.util.LinkedList;
   3: import java.util.List;
   4:         ...
   5:         }
   6:         return finalElementsSet.toArray();
   7:     }
   8:         ...
   9:         }
  10:         return finalChildrenSet.toArray();
  11:     }
  12:         ...
  13: 
  14:         private final LinkedList segments = new LinkedList();

View Full Code Here