CMCommon
, RoomnumberSet
, CMObject
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class DefaultRoomnumberSet extends java.lang.Object implements RoomnumberSet
Modifier and Type | Field | Description |
---|---|---|
STreeMap<java.lang.String,LongSet> |
root |
idConverter
Constructor | Description |
---|---|
DefaultRoomnumberSet() |
Modifier and Type | Method | Description |
---|---|---|
void |
add(RoomnumberSet set) |
Adds a set of room ids to this object
|
void |
add(java.lang.String str) |
Adds the given room id to this object
|
int |
compareTo(CMObject o) |
|
boolean |
contains(java.lang.String str) |
Returns whether the given room id is stored here
|
int[] |
convertRoomID(long coded) |
|
java.lang.String |
convertRoomID(java.lang.String prefix,
long coded) |
|
CMObject |
copyOf() |
Similar to Cloneable.clone(), but does its best to make sure that
any internal objects to this class are also copyOfed.
|
java.util.Iterator<java.lang.String> |
getAreaNames() |
Returns an enumerator for all area names in this object
|
LongSet |
getGrouper(java.lang.String areaName) |
Returns the number parts of the room ids stored in this
object for a given area.
|
long |
getLastChangedMs() |
Returns timestamp of when this was last altered
|
java.util.Enumeration<java.lang.String> |
getRoomIDs() |
Returns an enumerator for all room ids in this object
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
void |
initializeClass() |
Called ONCE after all objects are loaded, but before the map is read in
during initialization.
|
boolean |
isEmpty() |
Returns whether any rooms at all are defined.
|
java.lang.String |
name() |
The displayable name of this object.
|
CMObject |
newInstance() |
Returns a new instance of this class.
|
void |
parseXML(java.lang.String xml) |
Restores this object from an xml document
|
java.lang.String |
random() |
Returns a random, fully qualified room id from those
stored in here.
|
void |
remove(java.lang.String str) |
Removes a single room id from this object
|
int |
roomCount(java.lang.String areaName) |
Returns the number of room ids stored for the
given Area name.
|
int |
roomCountAllAreas() |
Returns the total number of room ids stored here
|
void |
setSingleAreaFlag(boolean tf) |
Sets whether this set should never contain more
than one Area.
|
java.lang.String |
xml() |
Converts the contents of this object into an xml
document.
|
public java.lang.String ID()
CMObject
public java.lang.String name()
CMObject
name
in interface CMObject
Environmental.Name()
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public CMObject copyOf()
CMObject
public void setSingleAreaFlag(boolean tf)
RoomnumberSet
setSingleAreaFlag
in interface RoomnumberSet
tf
- true to use one area, false for manypublic void add(RoomnumberSet set)
RoomnumberSet
add
in interface RoomnumberSet
set
- the room ids to addpublic void remove(java.lang.String str)
RoomnumberSet
remove
in interface RoomnumberSet
str
- the room id to remove from this objectpublic int roomCountAllAreas()
RoomnumberSet
roomCountAllAreas
in interface RoomnumberSet
public boolean isEmpty()
RoomnumberSet
isEmpty
in interface RoomnumberSet
public int roomCount(java.lang.String areaName)
RoomnumberSet
roomCount
in interface RoomnumberSet
areaName
- the Area to count the rooms ofpublic java.lang.String random()
RoomnumberSet
random
in interface RoomnumberSet
public int[] convertRoomID(long coded)
public java.lang.String convertRoomID(java.lang.String prefix, long coded)
public java.util.Iterator<java.lang.String> getAreaNames()
RoomnumberSet
getAreaNames
in interface RoomnumberSet
public LongSet getGrouper(java.lang.String areaName)
RoomnumberSet
getGrouper
in interface RoomnumberSet
areaName
- the area name to look forLongSet
public boolean contains(java.lang.String str)
RoomnumberSet
contains
in interface RoomnumberSet
str
- the room id to look forpublic java.lang.String xml()
RoomnumberSet
xml
in interface RoomnumberSet
public void parseXML(java.lang.String xml)
RoomnumberSet
parseXML
in interface RoomnumberSet
xml
- contents for this object as an xmlpublic void add(java.lang.String str)
RoomnumberSet
add
in interface RoomnumberSet
str
- a room idpublic java.util.Enumeration<java.lang.String> getRoomIDs()
RoomnumberSet
getRoomIDs
in interface RoomnumberSet
public long getLastChangedMs()
RoomnumberSet
getLastChangedMs
in interface RoomnumberSet