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

Variable Index

 o allProperties
 o deleteAction
is allowed to remove this atom from its parent
 o idProperty
 o modifyAction
is allowed to modify the properties of this atom.
 o moveAction
is allowed to change the parent of this atom - ie, move it around.
 o nameProperty
 o owner
 o ownerId
 o ownerProperty
 o parentProperty
 o permissionList
 o possessAction
is allowed to setOwnership of this atom.
 o referenceCountProperty
 o staticActions
The list of actions for Atom's.

Constructor Index

 o Atom()

Method Index

 o addAtomicProperty(String, Type)
 o addAtomicProperty(String, Type, Atom)
 o addBooleanProperty(String, Boolean)
 o addDataProperty(String, Type)
 o addDataProperty(String, Type, Object)
 o addDateTimeProperty(String, Duration)
 o addDurationProperty(String, Duration)
 o addIntegerProperty(String, Integer)
 o addParagraphProperty(String, Paragraph)
 o addProperty(Property)
 o addReadOnlyProperty(String, Type)
 o addReference(Referrer)
Called to tell the atom thats its being referenced by the referrer.
 o addReferenceProperty(String, Type)
 o addReferenceProperty(String, Type, Atom)
 o addStringProperty(String, String)
 o argument(String)
This method should be overridden if this command takes arguments.
 o aspect()
An atoms aspect is what you see when you look at it
 o assignInitialOwner()
Sets the owner to a player (if this is being executed as a player, or as null, otherwise
 o canSwap()
 o containsAction(Action)
Returns true if the action is supported by this class.
 o dispose()
This is a method that should be called only once.
 o 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
 o finaliseSymbol(Object, StringTokenizer, boolean)
Takes a matched symbol.
 o finalize()
 o fullResolve()
 o getAction(String)
Returns the action corresponding to the supplied name.
 o getActions()
Returns a list of the actions supported by this class.
 o getAllProperties()
 o getHasParent()
 o getId()
 o getKey()
 o getName()
 o getOwner()
 o getOwnerTag()
 o getParent()
 o getPermissionList()
 o getProperty(String)
Local search only - won't step into properties even if you put .'s inside the id
 o getSymbol(String)
Full search for the symbol of id s.
 o getSymbol(StringTokenizer, boolean)
Internal use - returns a partially resolved symbol.
 o getSymbolTag(String)
Full search for the symbol of id s.
 o getTag()
 o getThroughSymbol(StringTokenizer, boolean)
This is called internally.
 o getTotalAtoms()
 o help()
Returns *class* help about this atom.
 o isLoading()
 o isOwner(Atom)
Returns true if potential owns this atom (either directly or indirectly)
 o isSymbolTransit(String)
 o loadFrom(DataInput)
 o newAction(Collection, String, boolean)
Adds another action to the available actions in the collection provided.
 o noLongerOwning(Atom)
 o nowOwning(Atom)
 o partialLoad()
 o references()
 o removeReference(Referrer)
 o resolve()
 o setKey(Object)
 o setOwner(Atom)
 o setParent(Parent)
This routine not only sets the parent, but ensures that this atom is removed from its previous parent, as well.
 o setProperty(DataProperty, Object)
 o setProperty(ReferenceProperty, Object)
 o setProperty(String, Object)
 o setPropertyId(ReferenceProperty, String)
 o setSymbol(String, Object)
 o setTag(Tag)
 o splash(Effect, SuppressionList)
When an effect occurs, people within its "splash" range are notified (that is, they can choose to notice or ignore it).
 o swapout()
Similar to dispose(), the swapout() method prepares a Atom to be swapped out non-destructively You should probably sync() before doing this...
 o sync()
 o toString()
 o writeTo(DataOutput)

Variables

 o allProperties
 protected Collection allProperties
 o nameProperty
 protected ReadOnlyProperty nameProperty
 o parentProperty
 protected ReadOnlyProperty parentProperty
 o ownerProperty
 protected ReadOnlyProperty ownerProperty
 o idProperty
 protected ReadOnlyProperty idProperty
 o referenceCountProperty
 protected ReadOnlyProperty referenceCountProperty
 o permissionList
 protected PermissionList permissionList
 o owner
 protected Tag owner
 o ownerId
 protected String ownerId
 o 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().

 o moveAction
 protected static Action moveAction
is allowed to change the parent of this atom - ie, move it around.

 o modifyAction
 protected static Action modifyAction
is allowed to modify the properties of this atom.

 o possessAction
 protected static Action possessAction
is allowed to setOwnership of this atom.

 o deleteAction
 protected static Action deleteAction
is allowed to remove this atom from its parent

Constructors

 o Atom
 public Atom()

Methods

 o assignInitialOwner
 protected void assignInitialOwner()
Sets the owner to a player (if this is being executed as a player, or as null, otherwise

 o argument
 public void argument(String args) throws IllegalArgumentException
This method should be overridden if this command takes arguments.

 o addReference
 public void addReference(Referrer r)
Called to tell the atom thats its being referenced by the referrer.

 o removeReference
 public void removeReference(Referrer r)
 o references
 public final Enumeration references()
 o setKey
 public final void setKey(Object newkey)
 o getName
 public final String getName()
 o getKey
 public final Object getKey()
 o 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.

 o getParent
 public final Parent getParent()
 o getHasParent
 public final HasParent getHasParent()
 o setOwner
 public final synchronized void setOwner(Atom newOwner)
 o isOwner
 public boolean isOwner(Atom potential)
Returns true if potential owns this atom (either directly or indirectly)

 o getOwner
 public final Atom getOwner()
 o getOwnerTag
 public final Tag getOwnerTag()
 o noLongerOwning
 protected final void noLongerOwning(Atom a)
 o nowOwning
 protected final void nowOwning(Atom a)
 o 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

 o 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

 o setProperty
 public final void setProperty(String id,
                               Object value) throws NoSuchPropertyException, TypeMismatchException
 o setProperty
 protected final void setProperty(DataProperty p,
                                  Object value) throws NoSuchPropertyException, TypeMismatchException
 o setProperty
 protected final void setProperty(ReferenceProperty p,
                                  Object value) throws NoSuchPropertyException, TypeMismatchException
 o setPropertyId
 protected final void setPropertyId(ReferenceProperty p,
                                    String id)
 o 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
 o 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
 o isSymbolTransit
 public final boolean isSymbolTransit(String s)
 o 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?

 o setSymbol
 public final void setSymbol(String s,
                             Object value)
 o 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
 o 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

 o getAllProperties
 public final Enumeration getAllProperties()
 o 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...

 o canSwap
 public boolean canSwap()
 o 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.

 o getTag
 public final Tag getTag()
 o sync
 public void sync() throws IOException
 o setTag
 public final synchronized void setTag(Tag newTag)
 o writeTo
 public synchronized void writeTo(DataOutput to) throws IOException
 o partialLoad
 public synchronized void partialLoad()
 o isLoading
 public final boolean isLoading()
 o loadFrom
 public synchronized void loadFrom(DataInput from) throws IOException
 o addProperty
 protected final Property addProperty(Property p)
 o addBooleanProperty
 protected final DataProperty addBooleanProperty(String name,
                                                 Boolean value)
 o addIntegerProperty
 protected final DataProperty addIntegerProperty(String name,
                                                 Integer value)
 o addStringProperty
 protected final DataProperty addStringProperty(String name,
                                                String value)
 o addParagraphProperty
 protected final DataProperty addParagraphProperty(String name,
                                                   Paragraph value)
 o addDurationProperty
 protected final DataProperty addDurationProperty(String name,
                                                  Duration value)
 o addDateTimeProperty
 protected final DataProperty addDateTimeProperty(String name,
                                                  Duration value)
 o addReadOnlyProperty
 protected final ReadOnlyProperty addReadOnlyProperty(String name,
                                                      Type type)
 o addReferenceProperty
 protected final ReferenceProperty addReferenceProperty(String name,
                                                        Type type)
 o addReferenceProperty
 protected final ReferenceProperty addReferenceProperty(String name,
                                                        Type type,
                                                        Atom dflt)
 o addAtomicProperty
 protected final AtomicProperty addAtomicProperty(String name,
                                                  Type type)
 o addAtomicProperty
 protected final AtomicProperty addAtomicProperty(String name,
                                                  Type type,
                                                  Atom value)
 o addDataProperty
 protected final DataProperty addDataProperty(String name,
                                              Type type)
 o addDataProperty
 protected final DataProperty addDataProperty(String name,
                                              Type type,
                                              Object value)
 o getId
 public String getId()
 o resolve
 public void resolve()
 o fullResolve
 public synchronized void fullResolve()
 o toString
 public String toString()
Overrides:
toString in class Object
 o 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.

 o aspect
 public Paragraph aspect()
An atoms aspect is what you see when you look at it

 o 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

 o getPermissionList
 public final PermissionList getPermissionList()
 o 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

 o 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

 o 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.

 o newAction
 protected static final Action newAction(Collection actions,
                                         String name,
                                         boolean expert)
Adds another action to the available actions in the collection provided.

 o getTotalAtoms
 public static int getTotalAtoms()
 o finalize
 protected void finalize() throws Throwable
Overrides:
finalize in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index