|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.webapp.user.BookState
public class BookState
This class represents the state of a book for a given user. It stores the last page the user has been working on, the book id, the number of times the user has accessed the book, the date of the first and last time the book was opened.
| Constructor Summary | |
|---|---|
BookState()
|
|
BookState(String bookId)
Constructs a BookState for the book with the given ID |
|
| Method Summary | |
|---|---|
void |
access()
increases the number of accesses by one. |
String |
getBookId()
gets the id of the book this BookState is for |
BookStat |
getBookStat()
|
int |
getCurrentPage()
returns the current Page number |
long |
getFirstTimeOpened()
returns the Date when the correspondig book was first opened. |
long |
getLastAccess()
gets the Date the user last accessed the book. |
int |
getMastery()
Average mastery for this book. |
Integer |
getMasteryInt()
|
int |
getNumberOfAccesses()
gets the number of the times the book has been accessed. |
String |
getUserId()
|
void |
setBookStat(BookStat bookStat)
|
void |
setCurrentPage(int currentPage)
Sets the current Page number |
void |
setMastery(int mastery)
|
void |
setMasteryInt(Integer mastery)
For Hibernate: frickle with Integer to allow "null" in column. |
void |
setUserId(String userId)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BookState()
public BookState(String bookId)
id - The id of the book to create this BookState for.| Method Detail |
|---|
public String toString()
toString in class Objectpublic void access()
public void setCurrentPage(int currentPage)
currentPage - the new page to set as current page.public int getCurrentPage()
public long getLastAccess()
Date the user last accessed the book.
lastAccess.getTime()public String getBookId()
public long getFirstTimeOpened()
Date when the correspondig book was first opened.
Date Object initialized with firstTimeOpened.getTime().public int getNumberOfAccesses()
public int getMastery()
public void setMastery(int mastery)
public void setMasteryInt(Integer mastery)
public Integer getMasteryInt()
public String getUserId()
public void setUserId(String userId)
public BookStat getBookStat()
public void setBookStat(BookStat bookStat)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||