public class Event extends java.lang.Object implements java.lang.Comparable<Event>
Constructor and Description |
---|
Event(Item item,
java.lang.String date,
java.lang.String hour,
java.lang.String type,
java.lang.String borrowerStatus,
int sorter,
int delta)
Creates a new
Event related to an item. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Event other)
allows for a comparison of two events with respect to their timestamps.
|
java.lang.String |
getBorrowerStatus()
returns the status of the person initiating the event (student,
non-student member of university, external user, research faculty, other)
|
java.lang.String |
getDate()
returns the date (yyyy-MM-dd HH:mm) of the event
|
int |
getDelta()
returns the change of the overall number of items in a particular state
upon this event (a loan increases the number of loaned items by +1)
|
Event |
getEndEvent()
returns the
Event -object, for example the return to a loan
event. |
Item |
getItem()
retrieves the item related to this event.
|
long |
getTime()
returns the timestamp (in milliseconds) of the event.
|
java.lang.String |
getType()
returns the type of the event (loan, return, request, hold, inventory,
deletion or CALD)
|
java.lang.String |
getYear()
returns the year of the event
|
void |
setDate(java.lang.String newDate)
sets the Date of the event
|
void |
setEndEvent(Event endEvent)
relates to the end
Event -object, for example the return to a
loan event. |
public Event(Item item, java.lang.String date, java.lang.String hour, java.lang.String type, java.lang.String borrowerStatus, int sorter, int delta) throws java.text.ParseException
Event
related to an item.item
- the item related to this eventdate
- the date, wehn this events happenshour
- the hour, wehn this events happenstype
- the type of this eventborrowerStatus
- the status of the person initiating the eventsorter
- an additional sorter to allow sorting of events in the case of
multiple events at the same timedelta
- the change of the overall number of items in a particular
state upon this event (a loan increases the number of loaned
items by +1)java.text.ParseException
- exception parsing the date fieldpublic Item getItem()
public void setDate(java.lang.String newDate)
newDate
- the new Datepublic void setEndEvent(Event endEvent)
Event
-object, for example the return to a
loan event.endEvent
- the event ending the started processpublic Event getEndEvent()
Event
-object, for example the return to a loan
event.public java.lang.String getYear()
public long getTime()
public java.lang.String getDate()
public java.lang.String getType()
public java.lang.String getBorrowerStatus()
public int getDelta()
public int compareTo(Event other)
compareTo
in interface java.lang.Comparable<Event>