Package sc.util

Class SingleElementSet<T>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ISet<T>

    public class SingleElementSet<T>
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable, ISet<T>
    A lightweight set implementation for just one element.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SingleElementSet​(T elem)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.Object obj)  
      boolean contains​(java.lang.Object obj)  
      boolean containsAny​(ISet<T> other)  
      java.util.Iterator<T> iterator()  
      int size()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SingleElementSet

        public SingleElementSet​(T elem)
    • Method Detail

      • contains

        public boolean contains​(java.lang.Object obj)
        Specified by:
        contains in interface ISet<T>
      • containsAny

        public boolean containsAny​(ISet<T> other)
        Specified by:
        containsAny in interface ISet<T>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface ISet<T>
      • size

        public int size()
        Specified by:
        size in interface ISet<T>
      • add

        public boolean add​(java.lang.Object obj)
        Specified by:
        add in interface ISet<T>