|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.SimpleDataRecord<UserHouse>
org.starhope.appius.user.UserHouse
public class UserHouse
The User House object contains the rooms of the user's own house. Each user gets only one house, although we could maybe do some scary linkage things where rooms are discontinuous. There is a hard-coded assertion that room 0 is the main, lobby, entrance room of the user's house, and room 1 is the external front yard.
CREATE TABLE userHouseRooms (userID INT NOT NULL, roomID DECIMAL(1,0) UNSIGNED NOT NULL, PRIMARY KEY (userID, roomID), CONSTRAINT FOREIGN KEY (userID) REFERENCES users (ID)) ENGINE=InnoDB;
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
private ConcurrentHashMap<Integer,Boolean> |
hasRooms
Whether a room has been instantiated or not |
private ConcurrentHashMap<Integer,Room> |
houseRooms
The internal representation of the set of Rooms in the user's house |
private int |
houseTypeID
The view of the house from outside is hacked in like this for now XXX |
private int |
lotID
The type of lot for the outside is hacked in like this for now XXX |
private AbstractUser |
owner
The owner of this house |
private static long |
serialVersionUID
WRITEME: Document this brpocock@star-hope.org |
Fields inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
myLoader, timeLastChanged, timeLastSaved |
Constructor Summary | |
---|---|
UserHouse(AbstractUser newOwner)
Instantiate the house of the given user |
Method Summary | |
---|---|
void |
addRoom(int id)
WRITEME |
private void |
addRooms(Integer[] integers)
Add rooms of the given numbers for the owner |
void |
clear()
This is an overriding method. |
boolean |
containsKey(Object key)
This is an overriding method. |
boolean |
containsValue(Object value)
This is an overriding method. |
Set<Map.Entry<Integer,Room>> |
entrySet()
This is an overriding method. |
Room |
get(Object key)
This is an overriding method. |
int |
getCacheableID()
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both. |
String |
getCacheableIdent()
Note that all records must have either a numeric ID ( DataRecord.getCacheableID() or a string identifier (
DataRecord.getCacheableIdent() or both. |
int |
getHouseTypeID()
|
int |
getLotID()
WRITEME: document this method (brpocock@star-hope.org, Feb 19, 2010) |
AbstractUser |
getOwner()
|
String |
getSubversionRevision()
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence. |
private void |
instantiateRoom(Integer key)
instantiate the given room if it's called-for |
boolean |
isEmpty()
This is an overriding method. |
Set<Integer> |
keySet()
This is an overriding method. |
Room |
put(Integer key,
Room value)
This is an overriding method. |
void |
putAll(Map<? extends Integer,? extends Room> m)
This is an overriding method. |
Room |
remove(Object key)
This is an overriding method. |
void |
setHouseTypeID(int houseTypeID1)
WRITEME: document this method (brpocock@star-hope.org, Feb 19, 2010) |
void |
setLotID(int lotID1)
WRITEME: document this method (brpocock@star-hope.org, Feb 19, 2010) |
int |
size()
This is an overriding method. |
Collection<Room> |
values()
This is an overriding method. |
Methods inherited from class org.starhope.appius.util.SimpleDataRecord |
---|
changed, checkStale, compareTo, equals, finalize, getRecordLoader, getTimeLastChanged, getTimeLastSaved, hashCode, isBeingLoaded, markAsLoaded, markAsSaved, markForReload, onRemove, onRetrieve, onStore, save, setRecordLoader, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
private static final long serialVersionUID
private final ConcurrentHashMap<Integer,Room> houseRooms
private final ConcurrentHashMap<Integer,Boolean> hasRooms
private int houseTypeID
private int lotID
private final AbstractUser owner
Constructor Detail |
---|
public UserHouse(AbstractUser newOwner)
newOwner
- the owner of the houseMethod Detail |
---|
public void addRoom(int id)
id
- indexprivate void addRooms(Integer[] integers)
integers
- the room numberspublic void clear()
clear
in interface Map<Integer,Room>
Map.clear()
public boolean containsKey(Object key)
containsKey
in interface Map<Integer,Room>
Map.containsKey(java.lang.Object)
public boolean containsValue(Object value)
containsValue
in interface Map<Integer,Room>
Map.containsValue(java.lang.Object)
public Set<Map.Entry<Integer,Room>> entrySet()
entrySet
in interface Map<Integer,Room>
Map.entrySet()
public Room get(Object key)
get
in interface Map<Integer,Room>
Map.get(java.lang.Object)
public int getCacheableID() throws NotFoundException
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableID
in interface DataRecord
NotFoundException
- if the item doesn't have a distinct
numeric IDDataRecord.getCacheableID()
public String getCacheableIdent()
DataRecord
DataRecord.getCacheableID()
or a string identifier (
DataRecord.getCacheableIdent()
or both.
getCacheableIdent
in interface DataRecord
DataRecord.getCacheableIdent()
public int getHouseTypeID()
public int getLotID()
public AbstractUser getOwner()
public String getSubversionRevision()
HasSubversionRevision
Return the Subversion revision level of this class's source code file, as supplied via the special "$Rev: " sequence.
As an example,the Subversion revision string for this file is "$Rev: 1968 $"
@Override public String getSubversionRevision () { return "$Rev: "; }
getSubversionRevision
in interface HasSubversionRevision
HasSubversionRevision.getSubversionRevision()
private void instantiateRoom(Integer key)
key
- room numberpublic boolean isEmpty()
isEmpty
in interface Map<Integer,Room>
Map.isEmpty()
public Set<Integer> keySet()
keySet
in interface Map<Integer,Room>
Map.keySet()
public Room put(Integer key, Room value)
put
in interface Map<Integer,Room>
Map.put(java.lang.Object, java.lang.Object)
public void putAll(Map<? extends Integer,? extends Room> m)
putAll
in interface Map<Integer,Room>
Map.putAll(java.util.Map)
public Room remove(Object key)
remove
in interface Map<Integer,Room>
Map.remove(java.lang.Object)
public void setHouseTypeID(int houseTypeID1)
houseTypeID1
- WRITEMEpublic void setLotID(int lotID1)
lotID1
- WRITEMEpublic int size()
size
in interface Map<Integer,Room>
Map.size()
public Collection<Room> values()
values
in interface Map<Integer,Room>
Map.values()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |