Specified by: removeAll in interface Parameters: c - the collection of objects to be removed. Queue data structure, it is not implemented. Since this would violate the integrity of the abstract If implemented, it would remove a single instance of each item in the specifiedĬollection from the queue. Public boolean removeAll( c) This is an optional method of the Collection Interface. Returns: throws an UnsupportedOperationException Specified by: remove in interface Parameters: obj - the object to be removed. Since this would violate the integrity of the abstract queue If implemented, it would remove a single instance of the specified objectįrom the queue. Public boolean remove( obj) This is an optional method of the Collection Interface. Specified by: isEmpty in interface Returns: true - if this collection contains no elements. Public boolean isEmpty() Determines whether the queue is empty. Parameters: obj - the object being removeed from the queue Protected void downdateHashCode( obj) Downdates the hash code for this queue Parameters: obj - the object being added to the queue Protected void updateHashCode( obj) Updates the hash code for this queue Specified by: hashCode in interface Overrides: hashCode in class Returns: hash - the hashcode for this queue Mthsc865.datastructures package that have the same objects stored in This method should return the same hash code for any two queues in the Public int hashCode() Returns the value of the hash code for this queue. Returns: true - if the specified object is equal to this queue. Specified by: equals in interface Overrides: equals in class Parameters: obj - the object which may be equal to this queue. Public boolean equals( obj) The test for equality. Returns: true - if the queue contains all of the objects in the Specified by: containsAll in interface Parameters: c - the collection of objects to be found in the queue. Public boolean containsAll( c) Determines if the specified collection is contained in the queue. Returns: true - if the specified object is in the queue. Specified by: contains in interface Parameters: obj - the object to be found in the queue. Public boolean contains( obj) Determines if the specified object is in the queue. Returns: true if the collection has any elements, because the Specified by: addAll in interface Parameters: c - the collection of objects to be added to the queue. Public boolean addAll( c) Enqueues each object of the specified collection onto the queue. Returns: true if the object is not null, because the queue has been changed. Specified by: add in interface Parameters: x - the type T object to be placed at the end of the queue. This collection contains the specified object. Consistent with theĬollection interface requirement that this method should ensure that Public boolean add( T x) Enqueues an object onto the end of the queue. Public abstract T peek() Returns the type T object on the beginning of the queue. Returns: the object at the beginning of the queue or null if the queue is empty. Public abstract T dequeue() Removes and returns the type T object at the beginning of the queue. Parameters: x - the type T object to be appended to the end of the queue. Public abstract void enqueue( T x) Appends a T object onto the end of the queue. In the queue while the iterator is being used. The cached value of theĬode should be used by iterators to check for any changes It isĪssumed that push, pop, clear, and clone methods will Protected int hash The cached value of the hash code for the queue. Methods inherited from class Ĭlone, finalize, getClass, notify, notifyAll, wait, wait, wait This is an optional method of the Collection Interface.Ĭreates an array containing the objects in this queue. Returns the type T object on the beginning of the queue. Returns the value of the hash code for this queue. Removes and returns the type T object at the beginning of the queue.Īppends a T object onto the end of the queue. The cached value of the hash code for the queue.Įnqueues an object onto the end of the queue.Įnqueues each object of the specified collection onto the queue.ĭetermines if the specified object is in the queue.ĭetermines if the specified collection is contained in the queue. The optional methods of the Collections interface, which wouldĪllow the queue integrity to be violated are not implementedĪnd throw an UnsupportedOperation exception. It implements the enqueue, dequeue and convenience methods. Public abstract class AbstractQueue extends implements, Ībstract class for the queue data structure. All Implemented Interfaces:, , Direct Known Subclasses: QueueCL, QueueLL SUMMARY: NESTED | FIELD | CONSTR | METHOD
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |