Class VetoableModificationSet<T>

    • Constructor Detail

      • VetoableModificationSet

        public VetoableModificationSet()
    • Method Detail

      • internalAdd

        protected boolean internalAdd​(T element)
        Use this method to add elements without checking for vetoes.
        Parameters:
        element - element
      • internalAddAll

        protected boolean internalAddAll​(Collection<? extends T> c)
        Use this method to add elements without checking for vetoes.
        Parameters:
        c - collection
      • add

        public boolean add​(T element)
        Specified by:
        add in interface Collection<T>
        Specified by:
        add in interface Set<T>
        Overrides:
        add in class HashSet<T>
      • isAddable

        protected boolean isAddable​(T element)
        Is called before the given element is actually added to this collection. You may also use this method to notify another object of the pending addition.
        Parameters:
        element - object to add
        Returns:
        return true, if you want the element to be added, false otherwise
      • isRemovable

        protected boolean isRemovable​(Object o)
        Is called before the given object is actually removed from this collection. You may also use this method to notify another object of the pending removal.
        Parameters:
        o - object to remove
        Returns:
        return true, if the given element can be removed, false otherwise