|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.util.BaseDatum
org.starhope.appius.game.intangible.Event
public class Event
An Event is anything in-game which has a time reference (both a beginning and ending time are recorded, but they can be equal) and earns or costs currency. Earning currency is by virtue of earning points at a specific event type.
Field Summary | |
---|---|
private Date |
begin
|
private Date |
end
|
private BigDecimal |
points
|
private com.sun.sgs.app.ManagedReference<EventType> |
reason
|
private static long |
serialVersionUID
|
Fields inherited from class org.starhope.appius.util.BaseDatum |
---|
database_id |
Constructor Summary | |
---|---|
Event(EventType reason)
Create an event starting now (which can be changed) but with no points, not finished. |
|
Event(EventType reason,
BigDecimal points)
This is for an event where the number of points earned is already known (instantly) by the time that the event gets registered. |
|
Event(EventType reason,
int points)
Creates an event; syntactic sugar for Event(EventType, BigDecimal) |
|
Event(String reason)
Syntactic sugar for Event(EventType) |
|
Event(String reason,
BigDecimal points)
Creates an event; syntactic sugar for Event(EventType, BigDecimal) |
|
Event(String reason,
int points)
Syntactic sugar for Event(EventType, BigDecimal) |
Method Summary | |
---|---|
Date |
getBegin()
|
Date |
getEnd()
|
BigDecimal |
getPoints()
Gets the number of points earned at an event. |
EventType |
getReason()
Gets the event type |
void |
set(org.json.JSONObject o)
This method will attempt to set the data contents of this object to the values derived from the JSON object being passed-in. |
void |
setBegin(Date begin)
|
void |
setEnd(Date end)
|
void |
setPoints(BigDecimal points)
Set the number of points earned at this Event |
void |
setPoints(int points)
Syntactic sugar for setPoints(BigDecimal) using an
integer |
void |
setReason(EventType newReason)
Set the reason for the event |
org.json.JSONObject |
toJSON()
Creates a JSON representation of this object |
Methods inherited from class org.starhope.appius.util.BaseDatum |
---|
changed, commitToDatabase, delete, equals, flush, get, get, getID, getUniqueBoundName, readExternal, refJSON, setID, sqlDateTime, writeExternal |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private Date begin
private Date end
private BigDecimal points
private com.sun.sgs.app.ManagedReference<EventType> reason
Constructor Detail |
---|
public Event(EventType reason)
reason
- The type of eventpublic Event(EventType reason, BigDecimal points)
reason
- The type of event (e.g. game)points
- The number of points earnedpublic Event(EventType reason, int points)
Event(EventType, BigDecimal)
reason
- reason for earning pointspoints
- points earnedpublic Event(String reason) throws NotFoundException
Event(EventType)
reason
- the reason code string
NotFoundException
- if the reason specified is not definedpublic Event(String reason, BigDecimal points) throws NotFoundException
Event(EventType, BigDecimal)
reason
- the reason string for the event typepoints
- the number of points earned
NotFoundException
- if the specified EventType reason can't
be foundpublic Event(String reason, int points) throws NotFoundException
Event(EventType, BigDecimal)
reason
- reason stringpoints
- points earned
NotFoundException
- if the specified reason isn't a known
EventTypeMethod Detail |
---|
public Date getBegin()
public Date getEnd()
public BigDecimal getPoints()
public EventType getReason()
public void set(org.json.JSONObject o)
CastsToJSON
set
in interface CastsToJSON
set
in class BaseDatum
o
- The JSON object containing a the new data for this
object.CastsToJSON.set(org.json.JSONObject)
public void setBegin(Date begin)
begin
- the begin to setpublic void setEnd(Date end)
end
- the end to setpublic void setPoints(BigDecimal points)
points
- the number of points earnedpublic void setPoints(int points)
setPoints(BigDecimal)
using an
integer
points
- the number of points earnedpublic void setReason(EventType newReason)
newReason
- the EventTypepublic org.json.JSONObject toJSON()
toJSON
in interface CastsToJSON
toJSON
in class BaseDatum
BaseDatum.toJSON()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |