Package io.goobi.viewer.model.calendar
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
Abstract base class for calendar browsing items representing a time period (year, month, day, etc.).
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNo-arg constructor.protectedAbstractCalendarItem(String name, int value, int hits) Creates a new AbstractCalendarItem instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.goobi.viewer.model.calendar.ICalendarItem
compareTo
-
Field Details
-
name
-
value
protected int value -
hits
protected int hits -
selected
protected boolean selected
-
-
Constructor Details
-
AbstractCalendarItem
protected AbstractCalendarItem()No-arg constructor. -
AbstractCalendarItem
Creates a new AbstractCalendarItem instance.- Parameters:
name- display label for this itemvalue- numeric calendar value (e.g. day, month, year)hits- initial number of search hits
-
-
Method Details
-
getName
getName.- Specified by:
getNamein interfaceICalendarItem- Returns:
- the display name of this calendar item
-
getValue
public int getValue()getValue.- Specified by:
getValuein interfaceICalendarItem- Returns:
- a int.
-
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:
getHitsin interfaceICalendarItem- Returns:
- a int.
-
setHits
public void setHits(int hits) setHits.- Specified by:
setHitsin interfaceICalendarItem- Parameters:
hits- number of search hits for this item
-
isSelected
public boolean isSelected()isSelected.- Specified by:
isSelectedin interfaceICalendarItem- Returns:
- true if this calendar item is currently selected, false otherwise
-
setSelected
public void setSelected(boolean selected) setSelected.- Specified by:
setSelectedin interfaceICalendarItem- Parameters:
selected- true to mark this item as selected
-
isEmpty
public boolean isEmpty() -
addHits
-