1 24 25 package org.objectweb.dream.queue; 26 27 import java.util.LinkedList ; 28 29 import org.objectweb.dream.AbstractComponent; 30 import org.objectweb.dream.util.EmptyStringArray; 31 32 42 public class ListAddRemoveFirstLastImpl extends AbstractComponent 43 implements 44 List, 45 ListAddFirstLast, 46 ListRemoveFirstLast 47 { 48 49 private LinkedList list = new LinkedList (); 50 51 55 58 public void add(Object o) 59 { 60 list.add(o); 61 } 62 63 66 public Object remove() 67 { 68 return list.removeFirst(); 69 } 70 71 74 public boolean isEmpty() 75 { 76 return list.isEmpty(); 77 } 78 79 83 86 public void addLast(Object o) 87 { 88 list.addLast(o); 89 } 90 91 94 public void addFirst(Object o) 95 { 96 list.addFirst(o); 97 } 98 99 103 106 public Object getLast() 107 { 108 return list.getLast(); 109 } 110 111 114 public Object removeLast() 115 { 116 return list.removeLast(); 117 } 118 119 122 public Object getFirst() 123 { 124 return list.getFirst(); 125 } 126 127 130 public Object removeFirst() 131 { 132 return list.removeFirst(); 133 } 134 135 139 142 public String [] listFc() 143 { 144 return EmptyStringArray.EMPTY_STRING_ARRAY; 145 } 146 147 } | Popular Tags |