Class ArrayMapService

java.lang.Object
com.iu.javadatastructureslab.services.ArrayMapService

public class ArrayMapService extends Object
Service facade for the ArrayMap demo.
  • Constructor Details

    • ArrayMapService

      public ArrayMapService()
  • Method Details

    • addEntry

      public void addEntry(String key, String value)
      Adds or updates a key/value entry.
      Parameters:
      key - entry key
      value - entry value
    • removeEntry

      public void removeEntry(String key)
      Removes an entry by key.
      Parameters:
      key - entry key to remove
      Throws:
      IllegalArgumentException - when the key is not found
    • getEntries

      public List<Entry<String,String>> getEntries()
      Returns all stored entries.
      Returns:
      list of entries
    • getSize

      public int getSize()
      Returns the number of stored entries.
      Returns:
      entry count
    • getCapacity

      public int getCapacity()
      Returns the current bucket capacity.
      Returns:
      bucket capacity
    • getMap

      public ArrayMap<String,String> getMap()
      Exposes the underlying map instance.
      Returns:
      the backing ArrayMap