Package sleep.engine.types
Class MyLinkedList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList
-
- sleep.engine.types.MyLinkedList
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List
public class MyLinkedList extends java.util.AbstractSequentialList implements java.lang.Cloneable, java.io.Serializable, java.util.List- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MyLinkedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, java.lang.Object element)add an object to the list at the specified indexbooleanadd(java.lang.Object o)add an object to the listvoidcheckSafety()java.lang.Objectget(int index)get an object from the linked listjava.util.ListIteratorlistIterator(int index)java.lang.Objectremove(int index)remove an object at the specified indexintsize()java.util.ListsubList(int beginAt, int endAt)-
Methods inherited from class java.util.AbstractList
clear, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.List- Specified by:
sizein classjava.util.AbstractCollection
-
subList
public java.util.List subList(int beginAt, int endAt)- Specified by:
subListin interfacejava.util.List- Overrides:
subListin classjava.util.AbstractList
-
add
public boolean add(java.lang.Object o)
add an object to the list- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.List- Overrides:
addin classjava.util.AbstractList
-
add
public void add(int index, java.lang.Object element)add an object to the list at the specified index- Specified by:
addin interfacejava.util.List- Overrides:
addin classjava.util.AbstractSequentialList
-
get
public java.lang.Object get(int index)
get an object from the linked list- Specified by:
getin interfacejava.util.List- Overrides:
getin classjava.util.AbstractSequentialList
-
remove
public java.lang.Object remove(int index)
remove an object at the specified index- Specified by:
removein interfacejava.util.List- Overrides:
removein classjava.util.AbstractSequentialList
-
listIterator
public java.util.ListIterator listIterator(int index)
- Specified by:
listIteratorin interfacejava.util.List- Specified by:
listIteratorin classjava.util.AbstractSequentialList
-
checkSafety
public void checkSafety()
-
-