public class Counter extends Mod implements GeneralMod
Constructor and Description |
---|
Counter(int count)
JSON-driven constructor.
|
Modifier and Type | Method and Description |
---|---|
JSONLiteral |
encode(EncodeControl control)
Encode this mod for transmission or persistence.
|
void |
inc(User from)
Message handler for the 'inc' message.
|
attachTo, clone, context, ensureHolding, ensureInContext, ensureReachable, ensureSameContext, ensureSameUser, holder, isEphemeral, markAsChanged, markAsEphemeral, object
@JSONMethod(value="count") public Counter(int count)
public JSONLiteral encode(EncodeControl control)
@JSONMethod public void inc(User from) throws MessageHandlerException
from
- The user requesting the census.MessageHandlerException
- if 'from' is not in the same context as
this mod, or if this mod is attached to a user and 'from' is not that
user.Copyright © 2017. All rights reserved.