All Packages Class Hierarchy This Package Previous Next Index
Class key.Atom
java.lang.Object
|
+----key.Atom
- public class Atom
- extends Object
- implements Storable, Symbol, HasParent
-
allProperties
-
-
deleteAction
- is allowed to remove this atom from its parent
-
idProperty
-
-
modifyAction
- is allowed to modify the properties of this atom.
-
moveAction
- is allowed to change the parent of this atom - ie,
move it around.
-
nameProperty
-
-
owner
-
-
ownerId
-
-
ownerProperty
-
-
parentProperty
-
-
permissionList
-
-
possessAction
- is allowed to setOwnership of this atom.
-
referenceCountProperty
-
-
staticActions
- The list of actions for Atom's.
-
Atom()
-
-
addAtomicProperty(String, Type)
-
-
addAtomicProperty(String, Type, Atom)
-
-
addBooleanProperty(String, Boolean)
-
-
addDataProperty(String, Type)
-
-
addDataProperty(String, Type, Object)
-
-
addDateTimeProperty(String, Duration)
-
-
addDurationProperty(String, Duration)
-
-
addIntegerProperty(String, Integer)
-
-
addParagraphProperty(String, Paragraph)
-
-
addProperty(Property)
-
-
addReadOnlyProperty(String, Type)
-
-
addReference(Referrer)
- Called to tell the atom thats its being
referenced by the referrer.
-
addReferenceProperty(String, Type)
-
-
addReferenceProperty(String, Type, Atom)
-
-
addStringProperty(String, String)
-
-
argument(String)
- This method should be overridden if
this command takes arguments.
-
aspect()
- An atoms aspect is what you see when you look at it
-
assignInitialOwner()
- Sets the owner to a player (if this is being
executed as a player, or as null, otherwise
-
canSwap()
-
-
containsAction(Action)
- Returns true if the action is supported by
this class.
-
dispose()
- This is a method that should be called only once.
-
evalReadOnlyProperty(ReadOnlyProperty)
- override to return the correct value for the supplied property
make sure you call super.evalReadOnlyProperty if you don't
understand it before returning null
-
finaliseSymbol(Object, StringTokenizer, boolean)
- Takes a matched symbol.
-
finalize()
-
-
fullResolve()
-
-
getAction(String)
- Returns the action corresponding to the
supplied name.
-
getActions()
- Returns a list of the actions supported by
this class.
-
getAllProperties()
-
-
getHasParent()
-
-
getId()
-
-
getKey()
-
-
getName()
-
-
getOwner()
-
-
getOwnerTag()
-
-
getParent()
-
-
getPermissionList()
-
-
getProperty(String)
- Local search only - won't step into properties
even if you put .'s inside the id
-
getSymbol(String)
- Full search for the symbol of id s.
-
getSymbol(StringTokenizer, boolean)
- Internal use - returns a partially resolved symbol.
-
getSymbolTag(String)
- Full search for the symbol of id s.
-
getTag()
-
-
getThroughSymbol(StringTokenizer, boolean)
- This is called internally.
-
getTotalAtoms()
-
-
help()
- Returns *class* help about this atom.
-
isLoading()
-
-
isOwner(Atom)
- Returns true if potential owns this atom
(either directly or indirectly)
-
isSymbolTransit(String)
-
-
loadFrom(DataInput)
-
-
newAction(Collection, String, boolean)
- Adds another action to the available actions in the
collection provided.
-
noLongerOwning(Atom)
-
-
nowOwning(Atom)
-
-
partialLoad()
-
-
references()
-
-
removeReference(Referrer)
-
-
resolve()
-
-
setKey(Object)
-
-
setOwner(Atom)
-
-
setParent(Parent)
- This routine not only sets the parent, but ensures
that this atom is removed from its previous parent,
as well.
-
setProperty(DataProperty, Object)
-
-
setProperty(ReferenceProperty, Object)
-
-
setProperty(String, Object)
-
-
setPropertyId(ReferenceProperty, String)
-
-
setSymbol(String, Object)
-
-
setTag(Tag)
-
-
splash(Effect, SuppressionList)
- When an effect occurs, people within its
"splash" range are notified (that is, they
can choose to notice or ignore it).
-
swapout()
- Similar to dispose(), the swapout() method prepares a
Atom to be swapped out non-destructively
You should probably sync() before doing this...
-
sync()
-
-
toString()
-
-
writeTo(DataOutput)
-
allProperties
protected Collection allProperties
nameProperty
protected ReadOnlyProperty nameProperty
parentProperty
protected ReadOnlyProperty parentProperty
ownerProperty
protected ReadOnlyProperty ownerProperty
idProperty
protected ReadOnlyProperty idProperty
referenceCountProperty
protected ReadOnlyProperty referenceCountProperty
permissionList
protected PermissionList permissionList
owner
protected Tag owner
ownerId
protected String ownerId
staticActions
protected static StringKeyCollection staticActions
- The list of actions for Atom's. Each sub-class
that wants to have its own possible actions will
need to have their own collection, as well as
override the routines getActions(), containsAction(),
and getAction().
moveAction
protected static Action moveAction
- is allowed to change the parent of this atom - ie,
move it around.
modifyAction
protected static Action modifyAction
- is allowed to modify the properties of this atom.
possessAction
protected static Action possessAction
- is allowed to setOwnership of this atom.
deleteAction
protected static Action deleteAction
- is allowed to remove this atom from its parent
Atom
public Atom()
assignInitialOwner
protected void assignInitialOwner()
- Sets the owner to a player (if this is being
executed as a player, or as null, otherwise
argument
public void argument(String args) throws IllegalArgumentException
- This method should be overridden if
this command takes arguments.
addReference
public void addReference(Referrer r)
- Called to tell the atom thats its being
referenced by the referrer.
removeReference
public void removeReference(Referrer r)
references
public final Enumeration references()
setKey
public final void setKey(Object newkey)
getName
public final String getName()
getKey
public final Object getKey()
setParent
public final synchronized void setParent(Parent newParent)
- This routine not only sets the parent, but ensures
that this atom is removed from its previous parent,
as well.
getParent
public final Parent getParent()
getHasParent
public final HasParent getHasParent()
setOwner
public final synchronized void setOwner(Atom newOwner)
isOwner
public boolean isOwner(Atom potential)
- Returns true if potential owns this atom
(either directly or indirectly)
getOwner
public final Atom getOwner()
getOwnerTag
public final Tag getOwnerTag()
noLongerOwning
protected final void noLongerOwning(Atom a)
nowOwning
protected final void nowOwning(Atom a)
getProperty
public final Object getProperty(String id) throws NoSuchPropertyException
- Local search only - won't step into properties
even if you put .'s inside the id
evalReadOnlyProperty
public Object evalReadOnlyProperty(ReadOnlyProperty p)
- override to return the correct value for the supplied property
make sure you call super.evalReadOnlyProperty if you don't
understand it before returning null
setProperty
public final void setProperty(String id,
Object value) throws NoSuchPropertyException, TypeMismatchException
setProperty
protected final void setProperty(DataProperty p,
Object value) throws NoSuchPropertyException, TypeMismatchException
setProperty
protected final void setProperty(ReferenceProperty p,
Object value) throws NoSuchPropertyException, TypeMismatchException
setPropertyId
protected final void setPropertyId(ReferenceProperty p,
String id)
getSymbolTag
public final Object getSymbolTag(String s)
- Full search for the symbol of id s. Will step into properties
if you supply '.'s etc
- Returns:
- atom, the contents of a property, or null
getSymbol
public Object getSymbol(String s)
- Full search for the symbol of id s. Will step into properties
if you supply '.'s etc
- Returns:
- atom, the contents of a property, or null
isSymbolTransit
public final boolean isSymbolTransit(String s)
getThroughSymbol
protected Object getThroughSymbol(StringTokenizer st,
boolean resolveTags)
- This is called internally. It is very similar
to getSymbol, except that it won't evaluate a normal
property (it'll still evaluate a ROProperty. This
is useful, sometimes, say in setSymbol, where we
want the property, as opposed to its value. In
setSymbol, if its a ReadOnlyProperty, we can't touch
it anyway, so blah, y'know?
setSymbol
public final void setSymbol(String s,
Object value)
getSymbol
protected Object getSymbol(StringTokenizer st,
boolean resolveTags)
- Internal use - returns a partially resolved symbol.
This function requires that it is passed a stringtokenizer
containing elements like:
if the tokenizer doesn't start with a . it is assumed
(but only one)
- Returns:
- atom, a property, or null
finaliseSymbol
protected Object finaliseSymbol(Object o,
StringTokenizer st,
boolean resolveTags)
- Takes a matched symbol. If its a property and there are
more symbols following it, we can't tell the property to
resolve the remainder for us, we have to resolve the property
reference and then check what is matched. If what's matched
is an atom or a cached atom, we should tell it to resolve
the remainder of the references.
otherwise, step
getAllProperties
public final Enumeration getAllProperties()
swapout
public synchronized void swapout()
- Similar to dispose(), the swapout() method prepares a
Atom to be swapped out non-destructively
You should probably sync() before doing this...
canSwap
public boolean canSwap()
dispose
public synchronized void dispose()
- This is a method that should be called only once. It forces
the atom to remove all traces of itself from the program. If
a way of referencing this atom is added (any reference to this
atom is stored and the reverseReferences technique is *not* used,
code to clear these references must be added here.
This behaviour is essential for cached atoms, such as the player
class (and all its derivative classes - such as the friend scape)
when the player disconnects.
If you want to store&destroy the object, thats exactly what you have
to do. You can't dispose() and *then* write it, you must write it
out and then dispose it when you're finished with it. dispose()
does not guarantee that there is anything useable left in the class.
getTag
public final Tag getTag()
sync
public void sync() throws IOException
setTag
public final synchronized void setTag(Tag newTag)
writeTo
public synchronized void writeTo(DataOutput to) throws IOException
partialLoad
public synchronized void partialLoad()
isLoading
public final boolean isLoading()
loadFrom
public synchronized void loadFrom(DataInput from) throws IOException
addProperty
protected final Property addProperty(Property p)
addBooleanProperty
protected final DataProperty addBooleanProperty(String name,
Boolean value)
addIntegerProperty
protected final DataProperty addIntegerProperty(String name,
Integer value)
addStringProperty
protected final DataProperty addStringProperty(String name,
String value)
addParagraphProperty
protected final DataProperty addParagraphProperty(String name,
Paragraph value)
addDurationProperty
protected final DataProperty addDurationProperty(String name,
Duration value)
addDateTimeProperty
protected final DataProperty addDateTimeProperty(String name,
Duration value)
addReadOnlyProperty
protected final ReadOnlyProperty addReadOnlyProperty(String name,
Type type)
addReferenceProperty
protected final ReferenceProperty addReferenceProperty(String name,
Type type)
addReferenceProperty
protected final ReferenceProperty addReferenceProperty(String name,
Type type,
Atom dflt)
addAtomicProperty
protected final AtomicProperty addAtomicProperty(String name,
Type type)
addAtomicProperty
protected final AtomicProperty addAtomicProperty(String name,
Type type,
Atom value)
addDataProperty
protected final DataProperty addDataProperty(String name,
Type type)
addDataProperty
protected final DataProperty addDataProperty(String name,
Type type,
Object value)
getId
public String getId()
resolve
public void resolve()
fullResolve
public synchronized void fullResolve()
toString
public String toString()
- Overrides:
- toString in class Object
splash
public void splash(Effect e,
SuppressionList s)
- When an effect occurs, people within its
"splash" range are notified (that is, they
can choose to notice or ignore it). This
routine defaults to ignoring any effect,
but you may override it at will to recieve
any effect that it recieves.
aspect
public Paragraph aspect()
- An atoms aspect is what you see when you look at it
help
public Paragraph help()
- Returns *class* help about this atom. That is, help on the properties
that are available to be set on this atom. Ideally, for every type of
atom created this would be overridden (added to) so that help could be
recieved on every property of an atom
getPermissionList
public final PermissionList getPermissionList()
getActions
public Enumeration getActions()
- Returns a list of the actions supported by
this class. This routine will need to be
overridden by sub-classes using actions
containsAction
public boolean containsAction(Action a)
- Returns true if the action is supported by
this class. This routine will need to be
overridden by sub-classes using actions
getAction
public Action getAction(String name)
- Returns the action corresponding to the
supplied name. This routine will need to
be overriden by sub-classes using actions.
newAction
protected static final Action newAction(Collection actions,
String name,
boolean expert)
- Adds another action to the available actions in the
collection provided.
getTotalAtoms
public static int getTotalAtoms()
finalize
protected void finalize() throws Throwable
- Overrides:
- finalize in class Object
All Packages Class Hierarchy This Package Previous Next Index