Class AACCategory

java.lang.Object
AACCategory
All Implemented Interfaces:
AACPage

public class AACCategory extends Object implements AACPage
Represents the mappings for a single page of items that should be displayed
Author:
Catie Baker and YOUR NAME HERE
  • Constructor Details

    • AACCategory

      public AACCategory(String name)
      Creates a new empty category with the given name
      Parameters:
      name - the name of the category
  • Method Details

    • addItem

      public void addItem(String imageLoc, String text)
      Adds the image location, text pairing to the category
      Specified by:
      addItem in interface AACPage
      Parameters:
      imageLoc - the location of the image
      text - the text that image should speak
    • getCategory

      public String getCategory()
      Returns the name of the category
      Specified by:
      getCategory in interface AACPage
      Returns:
      the name of the category
    • hasImage

      public boolean hasImage(String imageLoc)
      Determines if the provided images is stored in the category
      Specified by:
      hasImage in interface AACPage
      Parameters:
      imageLoc - the location of the category
      Returns:
      true if it is in the category, false otherwise
    • getImageLocs

      public String[] getImageLocs()
      Returns an array of all the images in the category
      Specified by:
      getImageLocs in interface AACPage
      Returns:
      the array of image locations
    • select

      public String select(String imageLoc)
      Returns the text associated with the given image in this category
      Specified by:
      select in interface AACPage
      Parameters:
      imageLoc - the location of the image
      Returns:
      the text associated with the image
      Throws:
      NoSuchElementException - if the image provided is not in the current category