org.nodal.model
Interface Getter

All Superinterfaces:
TxnMonitorable
All Known Subinterfaces:
Setter
All Known Implementing Classes:
AtomicSetterUtil, GetterFilter, GetterUtil, SetterFilter, SetterUtil

public interface Getter
extends TxnMonitorable

Basic interface for accessing values (an accessor). The Getter represents a promise to be able obtain the current value of a resource whenever the get() method is called. Moreover, since this is an extension of the Monitored interface, we can register for notification of changes to the value of this resource.


Method Summary
 java.lang.Object get()
          Obtain the current value of the resource as an Object.
 boolean getBoolean()
          Obtain a boolean depiction of the current value of the resource if possible.
 byte getByte()
          Obtain a byte depiction of the current value of the resource if possible.
 char getChar()
          Obtain a char depiction of the current value of the resource if possible.
 double getDouble()
          Obtain a double depiction of the current value of the resource if possible.
 float getFloat()
          Obtain a float depiction of the current value of the resource if possible.
 int getInt()
          Obtain an int depiction of the current value of the resource if possible.
 long getLong()
          Obtain a long depiction of the current value of the resource if possible.
 Node getNode()
          Obtain a Node interface for the current value of the resource.
 short getShort()
          Obtain a short depiction of the current value of the resource if possible.
 java.lang.String getString()
          Obtain a String depiction of the current value of the resource.
 Path path()
          A Path to this Getter.
 Type type()
          The type of the value returned by this Getter.
 boolean valueEquals(java.lang.Object v)
          Check equality of the value that would be returned against the argument.
 
Methods inherited from interface org.nodal.model.TxnMonitorable
addTxnHandler, removeTxnHandler
 

Method Detail

path

public Path path()
A Path to this Getter. For a Getter that is Node.Property, the Path is normally the Node.path() extended with the property name.

Returns:
a bound Path that accesses this Getter

type

public Type type()
The type of the value returned by this Getter.

Returns:
the Type of value returned by a get() call

get

public java.lang.Object get()
Obtain the current value of the resource as an Object.


getString

public java.lang.String getString()
Obtain a String depiction of the current value of the resource.


getNode

public Node getNode()
Obtain a Node interface for the current value of the resource.


getBoolean

public boolean getBoolean()
Obtain a boolean depiction of the current value of the resource if possible.


getChar

public char getChar()
Obtain a char depiction of the current value of the resource if possible.


getByte

public byte getByte()
Obtain a byte depiction of the current value of the resource if possible.


getShort

public short getShort()
Obtain a short depiction of the current value of the resource if possible.


getInt

public int getInt()
Obtain an int depiction of the current value of the resource if possible.


getLong

public long getLong()
Obtain a long depiction of the current value of the resource if possible.


getFloat

public float getFloat()
Obtain a float depiction of the current value of the resource if possible.


getDouble

public double getDouble()
Obtain a double depiction of the current value of the resource if possible.


valueEquals

public boolean valueEquals(java.lang.Object v)

Check equality of the value that would be returned against the argument.

This is especially useful to avoid extraneous copies when we only need to test equality.