diff --git a/src/main/java/com/types/Queue.java b/src/main/java/com/types/Queue.java index 11cfe78b..19c74e64 100644 --- a/src/main/java/com/types/Queue.java +++ b/src/main/java/com/types/Queue.java @@ -7,21 +7,39 @@ import java.util.NoSuchElementException; * Interface to provide queue specific functionality to the implementing class * This interface only defines the functionality which the queue implementing classes require. * Any class having queue behaviour should implement this interface and override all of its methods + * * @param */ public interface Queue extends DataStructure { - //Method to add element - public boolean offer(T t) throws NullPointerException; + /** + * Method to add element + * + * @param t element + * @return boolean + * @throws NullPointerException + */ + boolean offer(T t) throws NullPointerException; - //Method to remove element - public T poll(); - - //Method to check element on head - public T peek(); - - //Method to check element on head. This throws exception on runtime if the queue is empty - public T element() throws NoSuchElementException; + /** + * Method to remove element + * + * @return element + */ + T poll(); + /** + * Method to check element on head + * + * @return element + */ + T peek(); + /** + * Method to check element on head. This throws exception on runtime if the queue is empty + * + * @return element + * @throws NoSuchElementException + */ + T element() throws NoSuchElementException; }