Class HashedSimpleLockIStoredList<T>

All Implemented Interfaces:
IHashEntry<Object,IStoredList<T>>, ICollection<T>, IStoredList<T>, IObjectsList, Iterable<T>

public class HashedSimpleLockIStoredList<T> extends SimpleLockStoredList<T>
hash-backed Read/Write Lock version of StoredList to be used with JDK 1.5+
  • Constructor Details

    • HashedSimpleLockIStoredList

      public HashedSimpleLockIStoredList(boolean Support_Random_Scans)
  • Method Details

    • add

      public IObjectInfo<T> add(T subject)
      store an element
      Specified by:
      add in interface ICollection<T>
      Overrides:
      add in class SimpleLockStoredList<T>
      Parameters:
      subject - element to store.
      Returns:
      an information node representing the inserted element; null if StoredList has been invalidated.
    • remove

      public void remove(IObjectInfo<T> oi)
      remove an element described by ObjectInfo
      Specified by:
      remove in interface IStoredList<T>
      Overrides:
      remove in class SimpleLockStoredList<T>
      Parameters:
      oi - an existing element between Tail and Head
    • removeByObject

      public boolean removeByObject(T obj)
      given an object scan the list, find it and remove it, returns true if found
      Specified by:
      removeByObject in interface ICollection<T>
      Overrides:
      removeByObject in class SimpleLockStoredList<T>
      Parameters:
      obj - element to remove
      Returns:
      true if object was removed; false otherwise (if element wasn't found)
    • contains

      public boolean contains(T obj)
      is this object contained in the SL ?
      Specified by:
      contains in interface ICollection<T>
      Overrides:
      contains in class SimpleLockStoredList<T>
      Parameters:
      obj - the element to search for
      Returns:
      true if element exists in the StoredList; false otherwise.