T - The type of user requests contained in the session.public class UserSession<T extends UserRequest> extends Object implements Iterable<T>
UserRequests. Each request follow the
previous one in time.| Modifier and Type | Field and Description |
|---|---|
protected Date |
endTime
The end time of the sequence.
|
protected Date |
startTime
The start time of the sequence.
|
| Constructor and Description |
|---|
UserSession(String userId)
Creates a new session for the user identified by the given id.
|
| Modifier and Type | Method and Description |
|---|---|
void |
enqueue(T request)
Add a new request to the session.
|
Date |
getEndTime()
Returns the end time of the sequence.
|
Date |
getStartTime()
Returns the start time of the sequence.
|
String |
getUserId()
Returns the id of the user who issued this request.
|
Iterator<T> |
iterator() |
void |
setUserId(String userId)
Set the id of the user who issued this request.
|
int |
size()
Returns the number of requests in the session.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected Date startTime
protected Date endTime
public UserSession(String userId)
userId - The id of the user issuing the requests of the session.public String getUserId()
public void setUserId(String userId)
userId - The new user's id.public Date getStartTime()
public Date getEndTime()
public int size()
public Iterator<T> iterator()
iterator in interface Iterable<T extends UserRequest>public void enqueue(T request)
request - The request to add. Has to be later than the last request
added to the session (request.getTime() > this.getEndTime() ).Copyright © 2014–2018 University of Namur. All rights reserved.