Java Collections is a framework that provides numerous operations over a collection - searching, sorting, insertion, manipulation, deletion, etc. These classes mostly offer different ways to formulate a collection of objects within a single one. There are many collection classes in Java and all of them extend the and interfaces. element) Specified by: add in interface Java Collections Framework is a fundamental and essential framework that any strong Java developer should know like the back of their hand.Ī Collection in Java is defined as a group or collection of individual objects that act as a single object. Public toArray( a) Specified by: toArray in interface Specified by: toArray in interface Public toArray() Specified by: toArray in interface Specified by: toArray in interface element) Specified by: set in interface Public get(int index) Specified by: get in interface Public listIterator(int index) Specified by: listIterator in interface Public listIterator() Specified by: listIterator in interface Int toIndex) Specified by: subList in interface Public iterator() Specified by: iterator in interface Specified by: iterator in interface Specified by: iterator in interface Public int lastIndexOf( o) Specified by: lastIndexOf in interface Public int indexOf( o) Specified by: indexOf in interface Public boolean retainAll( c) Specified by: retainAll in interface Specified by: retainAll in interface Public boolean removeAll( c) Specified by: removeAll in interface Specified by: removeAll in interface Public boolean remove( o) Specified by: remove in interface Specified by: remove in interface Public boolean addAll( c) Specified by: addAll in interface Specified by: addAll in interface Public boolean containsAll( c) Specified by: containsAll in interface Specified by: containsAll in interface Specified by: contains in interface Specified by: contains in interface Public boolean contains( o) Methods in List interface that are not implemented. Throws: FullQueueException - if the queue is full. Returns: Q_Node node holding the new item Throws FullQueueException Insert an element into the queue and return holding node. Returns: boolean whether insertion suceeded Specified by: add in interface Specified by: add in interface Parameters: item - new item to be added Throws FullQueueException if * the size of the queue is out of capacity. Public boolean add( item) Insert an element into the queue. Specified by: clear in interface Specified by: clear in interface Public void clear() Remove all elements from the queue. Protected void removeMin() Remove the node containing the minimum/first element from the queue. Specified by: remove in interface Parameters: index - list position (must be 0) Method for compliance with List interface. Public remove(int index) Remove the node containing the minimum/first element from the queue. If first node has been cancelled (not present), continue to remove. Throws Remove and return the first element in the queue. Public void cancel( Q_Node node) Cancel (remove) node from the queue. Returns: Q_Node node containing first item Throws Return the first element in the queue without removing it. Specified by: size in interface Specified by: size in interface Returns: int queue length Public int size() Return the number of elements in the queue. Public boolean isFull() Return whether the queue is full (true for full, false for not full). Specified by: isEmpty in interface Specified by: isEmpty in interface Returns: boolean whether queue is empty Public boolean isEmpty() Return whether the queue is empty (true for empty, false for nonempty). Protected int capacity Maximum number of elements allowed Protected int size Current number of elements Protected Q_Node root Root (front) of queue Methods inherited from class Ĭlone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Return the number of elements in the queue. Remove the node containing the minimum/first element from the queue. Remove and return the first element in the queue. Return whether the queue is full (true for full, false for not full). Return whether the queue is empty (true for empty, false for nonempty). Return the first element in the queue without removing it. Methods in List interface that are not implemented. Insert an element into the queue and return holding node. Version: 1.0 96/07/10 Author: Zhiwei Zhang, John Miller Public abstract class Queue extends implements Ĭlass Queue is an abstract class which pure virtual functions must be All Implemented Interfaces:, , Direct Known Subclasses: FIFO_Queue, LIFO_Queue, PriorityQueue SUMMARY: NESTED | FIELD | CONSTR | METHOD
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |