com.threerings.presents.dobj
Class Accessor

java.lang.Object
  extended by com.threerings.presents.dobj.Accessor
All Implemented Interfaces:
Comparable<Accessor>
Direct Known Subclasses:
Accessor.ByField

public abstract class Accessor
extends Object
implements Comparable<Accessor>

Used by DObject to provide dynamic access to its fields. This class is an implementation detail that can be safely ignored. It is only a public top-level class to ensure that bindings for other languages can make use of it without complications.


Nested Class Summary
static class Accessor.ByField
          An accessor that assumes DObject fields are public Java fields.
 
Field Summary
 String name
          The name of this attribute.
 
Constructor Summary
protected Accessor(String name)
           
 
Method Summary
 int compareTo(Accessor other)
           
abstract  Object get(DObject obj)
          Gets the current value of this attribute.
abstract  void set(DObject obj, Object value)
          Updates the current value of this attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public final String name
The name of this attribute.

Constructor Detail

Accessor

protected Accessor(String name)
Method Detail

get

public abstract Object get(DObject obj)
Gets the current value of this attribute.


set

public abstract void set(DObject obj,
                         Object value)
Updates the current value of this attribute.


compareTo

public int compareTo(Accessor other)
Specified by:
compareTo in interface Comparable<Accessor>