Class CalendarItemCentury

java.lang.Object
io.goobi.viewer.model.calendar.AbstractCalendarItem
io.goobi.viewer.model.calendar.CalendarItemCentury
All Implemented Interfaces:
ICalendarItem, Serializable, Comparable<ICalendarItem>

public class CalendarItemCentury extends AbstractCalendarItem implements Serializable
Calendar browsing item representing a single century.
See Also:
  • Constructor Details

    • CalendarItemCentury

      public CalendarItemCentury(String name, int value, int hits)
      Creates a new CalendarItemYear instance.
      Parameters:
      name - display label for the century
      value - numeric century value
      hits - initial number of search hits
    • CalendarItemCentury

      public CalendarItemCentury(Integer century)
  • Method Details

    • getYears

      public List<CalendarItemYear> getYears()
      Getter for the field years.
      Returns:
      a sorted list of yearly calendar items within this century
    • getYear

      public CalendarItemYear getYear(Integer year)
    • addYearHits

      public void addYearHits(Integer year, Integer hits)
      Adds the given hits count to the given year within the century, creating a new item in getYears() if necessary. The hits count is both added to the year item and the century itself, so there is no need to additionally call AbstractCalendarItem.addHits(Integer) on the century
      Parameters:
      year - the year of the hits
      hits - the hit count for the given year
    • toString

      public String toString()
      Overrides:
      toString in class Object