Class AbstractCalendarItem

java.lang.Object
io.goobi.viewer.model.calendar.AbstractCalendarItem
All Implemented Interfaces:
ICalendarItem, Comparable<ICalendarItem>
Direct Known Subclasses:
CalendarItemCentury, CalendarItemDay, CalendarItemMonth, CalendarItemWeek, CalendarItemYear

public abstract class AbstractCalendarItem extends Object implements ICalendarItem
Abstract base class for calendar browsing items representing a time period (year, month, day, etc.).
  • Field Details

    • name

      protected String name
    • value

      protected int value
    • hits

      protected int hits
    • selected

      protected boolean selected
  • Constructor Details

    • AbstractCalendarItem

      protected AbstractCalendarItem()
      No-arg constructor.
    • AbstractCalendarItem

      protected AbstractCalendarItem(String name, int value, int hits)
      Creates a new AbstractCalendarItem instance.
      Parameters:
      name - display label for this item
      value - numeric calendar value (e.g. day, month, year)
      hits - initial number of search hits
  • Method Details

    • getName

      public String getName()
      getName.
      Specified by:
      getName in interface ICalendarItem
      Returns:
      the display name of this calendar item
    • getValue

      public int getValue()
      getValue.
      Specified by:
      getValue in interface ICalendarItem
      Returns:
      a int.
    • getFormattedValue

      public String getFormattedValue()
      Returns a two-digit string representation of this item's value.
      Returns:
      the value of this calendar item formatted as a zero-padded two-digit string
    • getHits

      public int getHits()
      getHits.
      Specified by:
      getHits in interface ICalendarItem
      Returns:
      a int.
    • setHits

      public void setHits(int hits)
      setHits.
      Specified by:
      setHits in interface ICalendarItem
      Parameters:
      hits - number of search hits for this item
    • isSelected

      public boolean isSelected()
      isSelected.
      Specified by:
      isSelected in interface ICalendarItem
      Returns:
      true if this calendar item is currently selected, false otherwise
    • setSelected

      public void setSelected(boolean selected)
      setSelected.
      Specified by:
      setSelected in interface ICalendarItem
      Parameters:
      selected - true to mark this item as selected
    • isEmpty

      public boolean isEmpty()
    • addHits

      public void addHits(Integer additionalHits)