diff --git a/jlib/Sequence.java b/jlib/Sequence.java index 6b2cd95..f5f693c 100644 --- a/jlib/Sequence.java +++ b/jlib/Sequence.java @@ -12,6 +12,12 @@ public class Sequence { this.previous = new LinkedList(); } + /** + * Adds an element to the sequence. If the sequence contains the maximum amount + * of elements, it will remove the first element from the sequence. + * + * @param e The element to add to the sequence + */ public void add(T e) { if (this.previous.size() == this.max) { this.previous.pop(); @@ -19,10 +25,18 @@ public class Sequence { this.previous.add(e); } + /** + * Provides info on how many elements are currently in the sequence. + * + * @return The number of elements in the sequence + */ public Integer size() { return this.previous.size(); } + /** + * Determines if all of the elements in the sequence are unique or not. + */ public Boolean isUnique() { HashSet s = new HashSet<>(); for (T e : this.previous) {