Interface HierarchicalRepository<T>

All Known Implementing Classes:
HierarchicalObjectRepository

public interface HierarchicalRepository<T>
allows objects to be mapped against a regex pattern and held in order in a list
  • Method Details

    • disableListeners

      void disableListeners()
    • enableListeners

      void enableListeners()
    • addMatch

      void addMatch(String match, T value)
      Add a new match to the repository
      Parameters:
      match - the pattern to use to match against
      value - the value to hold against the match
    • addMatch

      void addMatch(String match, T value, boolean immutableMatch)
      Add a new match to the repository
      Parameters:
      match - the pattern to use to match against
      value - the value to hold against the match
    • addMatch

      void addMatch(String match, T value, boolean immutableMatch, boolean notifyListeners)
      Add a new match to the repository
      Parameters:
      match - the pattern to use to match against
      value - the value to hold against the match
      immutableMatch - whether this match can be removed
      notifyListeners - whether to notify any listeners that the match has been added
    • getMatch

      T getMatch(String match)
      return the value held against the nearest match
      Parameters:
      match - the match to look for
      Returns:
      the value
    • values

      List<T> values()
      Return a list of Values being added
    • setDefault

      void setDefault(T defaultValue)
      set the default value to fallback to if none found
      Parameters:
      defaultValue - the value
    • getDefault

      T getDefault()
      Returns the default match for this repo.
      Returns:
      the default match for this repo
    • removeMatch

      void removeMatch(String match)
      remove a match from the repository
      Parameters:
      match - the match to remove
    • registerListener

      void registerListener(HierarchicalRepositoryChangeListener listener)
      register a listener to listen for changes in the repository
    • unRegisterListener

      void unRegisterListener(HierarchicalRepositoryChangeListener listener)
      unregister a listener
    • clear

      void clear()
      clear the repository
    • swap

      void swap(Set<Map.Entry<String,T>> entries)
    • clearListeners

      void clearListeners()
      Removes all listeners.
    • clearCache

      void clearCache()
      Clears the cache.
    • getCacheSize

      int getCacheSize()
    • containsExactMatch

      boolean containsExactMatch(String match)
    • containsExactWildcardMatch

      boolean containsExactWildcardMatch(String match)