Class TransformSet<E>

  • All Implemented Interfaces:
    ITransformableObject, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

    public class TransformSet<E>
    extends SetWrapper<E>
    implements ITransformableObject
    A set that transforms itself, i.e. makes a copy of itself. This ensures that the serializer has no concurrent access to the base object.
    • Constructor Summary

      Constructors 
      Constructor Description
      TransformSet()
      Create a new TransformSet.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(E e)  
      boolean addAll​(java.util.Collection<? extends E> coll)  
      void addChangeListener​(IChangeListener<E> lis)
      Add a change listener.
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> coll)  
      protected void entryAdded​(E value, int index)
      An entry was added to the collection.
      protected void entryChanged​(E oldvalue, E newvalue, int index)
      An entry was changed in the collection.
      protected void entryRemoved​(E value, int index)
      An entry was removed from the collection.
      boolean equals​(java.lang.Object o)
      Test if this object equals another.
      int hashCode()
      Get the hashcode of the object.
      boolean isEmpty()  
      java.util.Iterator<E> iterator()  
      protected void notifyListeners​(ChangeEvent<E> event)
      Notify listeners of a change event.
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> coll)  
      void removeChangeListener​(IChangeListener<E> lis)
      Add a change listener.
      boolean retainAll​(java.util.Collection<?> coll)  
      int size()
      Get the size.
      java.lang.Object[] toArray()  
      <T> T[] toArray​(T[] a)  
      java.lang.String toString()
      Get the string representation.
      java.lang.Object transform()
      Return a transformed object.
      • Methods inherited from class java.lang.Object

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

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        spliterator
    • Constructor Detail

      • TransformSet

        public TransformSet()
        Create a new TransformSet.
    • Method Detail

      • size

        public int size()
        Description copied from class: CollectionWrapper
        Get the size.
        Specified by:
        size in interface java.util.Collection<E>
        Specified by:
        size in interface java.util.Set<E>
        Overrides:
        size in class CollectionWrapper<E>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<E>
        Specified by:
        isEmpty in interface java.util.Set<E>
        Overrides:
        isEmpty in class CollectionWrapper<E>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<E>
        Specified by:
        contains in interface java.util.Set<E>
        Overrides:
        contains in class CollectionWrapper<E>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<E>
        Specified by:
        toArray in interface java.util.Set<E>
        Overrides:
        toArray in class CollectionWrapper<E>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<E>
        Specified by:
        toArray in interface java.util.Set<E>
        Overrides:
        toArray in class CollectionWrapper<E>
      • iterator

        public java.util.Iterator<E> iterator()
        Specified by:
        iterator in interface java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>
        Specified by:
        iterator in interface java.util.Set<E>
        Overrides:
        iterator in class CollectionWrapper<E>
      • add

        public boolean add​(E e)
        Specified by:
        add in interface java.util.Collection<E>
        Specified by:
        add in interface java.util.Set<E>
        Overrides:
        add in class CollectionWrapper<E>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<E>
        Specified by:
        remove in interface java.util.Set<E>
        Overrides:
        remove in class CollectionWrapper<E>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> coll)
        Specified by:
        containsAll in interface java.util.Collection<E>
        Specified by:
        containsAll in interface java.util.Set<E>
        Overrides:
        containsAll in class CollectionWrapper<E>
      • addAll

        public boolean addAll​(java.util.Collection<? extends E> coll)
        Specified by:
        addAll in interface java.util.Collection<E>
        Specified by:
        addAll in interface java.util.Set<E>
        Overrides:
        addAll in class CollectionWrapper<E>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> coll)
        Specified by:
        removeAll in interface java.util.Collection<E>
        Specified by:
        removeAll in interface java.util.Set<E>
        Overrides:
        removeAll in class CollectionWrapper<E>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> coll)
        Specified by:
        retainAll in interface java.util.Collection<E>
        Specified by:
        retainAll in interface java.util.Set<E>
        Overrides:
        retainAll in class CollectionWrapper<E>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<E>
        Specified by:
        clear in interface java.util.Set<E>
        Overrides:
        clear in class CollectionWrapper<E>
      • toString

        public java.lang.String toString()
        Description copied from class: CollectionWrapper
        Get the string representation.
        Overrides:
        toString in class CollectionWrapper<E>
        Returns:
        The string representation.
      • equals

        public boolean equals​(java.lang.Object o)
        Description copied from class: CollectionWrapper
        Test if this object equals another.
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.Set<E>
        Overrides:
        equals in class CollectionWrapper<E>
        Parameters:
        o - The other object.
        Returns:
        True, if equal.
      • hashCode

        public int hashCode()
        Description copied from class: CollectionWrapper
        Get the hashcode of the object.
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.Set<E>
        Overrides:
        hashCode in class CollectionWrapper<E>
        Returns:
        The hashcode.
      • transform

        public java.lang.Object transform()
        Return a transformed object.
        Specified by:
        transform in interface ITransformableObject
        Returns:
        A transformed version of the object.
      • entryAdded

        protected void entryAdded​(E value,
                                  int index)
        An entry was added to the collection.
        Specified by:
        entryAdded in class CollectionWrapper<E>
      • entryRemoved

        protected void entryRemoved​(E value,
                                    int index)
        An entry was removed from the collection.
        Specified by:
        entryRemoved in class CollectionWrapper<E>
      • entryChanged

        protected void entryChanged​(E oldvalue,
                                    E newvalue,
                                    int index)
        An entry was changed in the collection.
        Specified by:
        entryChanged in class CollectionWrapper<E>
      • notifyListeners

        protected void notifyListeners​(ChangeEvent<E> event)
        Notify listeners of a change event.
        Parameters:
        event - The event.
      • addChangeListener

        public void addChangeListener​(IChangeListener<E> lis)
        Add a change listener.
        Parameters:
        lis - The listener.
      • removeChangeListener

        public void removeChangeListener​(IChangeListener<E> lis)
        Add a change listener.
        Parameters:
        lis - The listener.