Klasse ObjectCollections

java.lang.Object
speiger.src.collections.objects.utils.ObjectCollections

public class ObjectCollections extends Object
A Helper class for Collections
  • Felddetails

    • EMPTY

      public static final ObjectCollection<?> EMPTY
      Empty Collection Reference
  • Konstruktordetails

    • ObjectCollections

      public ObjectCollections()
  • Methodendetails

    • empty

      public static <T> ObjectCollection<T> empty()
      Returns a Immutable EmptyCollection instance that is automatically casted.
      Typparameter:
      T - the keyType of elements maintained by this Collection
      Gibt zurück:
      an empty collection
    • unmodifiable

      public static <T> ObjectCollection<T> unmodifiable(ObjectCollection<T> c)
      Returns a Immutable Collection instance based on the instance given.
      Typparameter:
      T - the keyType of elements maintained by this Collection
      Parameter:
      c - that should be made immutable/unmodifiable
      Gibt zurück:
      a unmodifiable collection wrapper. If the Collection already a unmodifiable wrapper then it just returns itself.
    • synchronize

      public static <T> ObjectCollection<T> synchronize(ObjectCollection<T> c)
      Returns a synchronized Collection instance based on the instance given.
      Typparameter:
      T - the keyType of elements maintained by this Collection
      Parameter:
      c - that should be synchronized
      Gibt zurück:
      a synchronized collection wrapper. If the Collection already a synchronized wrapper then it just returns itself.
    • synchronize

      public static <T> ObjectCollection<T> synchronize(ObjectCollection<T> c, Object mutex)
      Returns a synchronized Collection instance based on the instance given.
      Typparameter:
      T - the keyType of elements maintained by this Collection
      Parameter:
      c - that should be synchronized
      mutex - is the controller of the synchronization block.
      Gibt zurück:
      a synchronized collection wrapper. If the Collection already a synchronized wrapper then it just returns itself.
    • singleton

      public static <T> ObjectCollection<T> singleton(T element)
      Creates a Singleton Collection of a given element
      Typparameter:
      T - the keyType of elements maintained by this Collection
      Parameter:
      element - the element that should be converted into a singleton collection
      Gibt zurück:
      a singletoncollection of the given element