Class DualValueDeque

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<DualValue>, java.util.Collection<DualValue>, java.util.Deque<DualValue>, java.util.List<DualValue>, java.util.Queue<DualValue>

    class DualValueDeque
    extends java.util.LinkedList<DualValue>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, DualValue dualKey)  
      boolean add​(DualValue dualKey)  
      boolean addAll​(int index, java.util.Collection<? extends DualValue> collection)  
      void addFirst​(DualValue dualKey)  
      void addLast​(DualValue dualKey)  
      private boolean shouldAddDualKey​(DualValue dualKey)  
      private boolean shouldNotEvaluate​(DualValue dualValue)
      Decides whether the value needs to evaluated, note that we need to evaluate all values if we have compared types registered as a value could have fields of type to compare.
      • Methods inherited from class java.util.LinkedList

        addAll, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
      • Methods inherited from class java.util.AbstractSequentialList

        iterator
      • Methods inherited from class java.util.AbstractList

        equals, hashCode, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        containsAll, isEmpty, removeAll, retainAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream
      • Methods inherited from interface java.util.Deque

        iterator
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
    • Method Detail

      • add

        public boolean add​(DualValue dualKey)
        Specified by:
        add in interface java.util.Collection<DualValue>
        Specified by:
        add in interface java.util.Deque<DualValue>
        Specified by:
        add in interface java.util.List<DualValue>
        Specified by:
        add in interface java.util.Queue<DualValue>
        Overrides:
        add in class java.util.LinkedList<DualValue>
      • add

        public void add​(int index,
                        DualValue dualKey)
        Specified by:
        add in interface java.util.List<DualValue>
        Overrides:
        add in class java.util.LinkedList<DualValue>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends DualValue> collection)
        Specified by:
        addAll in interface java.util.List<DualValue>
        Overrides:
        addAll in class java.util.LinkedList<DualValue>
      • addFirst

        public void addFirst​(DualValue dualKey)
        Specified by:
        addFirst in interface java.util.Deque<DualValue>
        Overrides:
        addFirst in class java.util.LinkedList<DualValue>
      • addLast

        public void addLast​(DualValue dualKey)
        Specified by:
        addLast in interface java.util.Deque<DualValue>
        Overrides:
        addLast in class java.util.LinkedList<DualValue>
      • shouldNotEvaluate

        private boolean shouldNotEvaluate​(DualValue dualValue)
        Decides whether the value needs to evaluated, note that we need to evaluate all values if we have compared types registered as a value could have fields of type to compare.

        For example if we want to compare Employee in a Company, we need to evaluate company as it holds a list of Employee.

        Parameters:
        dualValue - the value to check
        Returns:
        true if we want to register the value for evaluation, false otherwise
      • shouldAddDualKey

        private boolean shouldAddDualKey​(DualValue dualKey)