gishur.gui2.adapter
Class ObjectAdapter

java.lang.Object
  |
  +--gishur.gui2.SourcePropertyAdapter
        |
        +--gishur.gui2.adapter.ObjectAdapter
Direct Known Subclasses:
ColorNameAdapter

public class ObjectAdapter
extends SourcePropertyAdapter

A SourcePropertyAdapter, that maps a palette of objects to other objects. The objects are read via another SourcePropertyAdapter.

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
ObjectAdapter(SourcePropertyAdapter source)
          Constructs a new ObjectAdapter, which gets its objects from the given SourcePropertyAdapter.
ObjectAdapter(SourcePropertyAdapter source, ObjectAdapter base)
          Constructs a new ObjectAdapter, which gets its objects from the given SourcePropertyAdapter.
 
Method Summary
 void add(java.lang.Object source, java.lang.Object target)
          Maps the given source Object to its target Object.
 java.lang.Object getProperty(java.lang.String key, java.lang.Object source, PropertyStatusReader prop)
          Returns a property value with a given key using the source-object (and perhaps the given PropertyStatusReader).
 java.lang.Object nullValue()
          Returns the value returned by reading null
 void setNullValue(java.lang.Object nu)
          Sets the value returned by reading null
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectAdapter

public ObjectAdapter(SourcePropertyAdapter source,
                     ObjectAdapter base)
Constructs a new ObjectAdapter, which gets its objects from the given SourcePropertyAdapter.
Parameters:
source - SourcePropertyAdapter to get objects
base - the ObjectAdapter, which object table to share

ObjectAdapter

public ObjectAdapter(SourcePropertyAdapter source)
Constructs a new ObjectAdapter, which gets its objects from the given SourcePropertyAdapter.
Parameters:
source - SourcePropertyAdapter to get object
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the object.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

setNullValue

public void setNullValue(java.lang.Object nu)
Sets the value returned by reading null
Parameters:
nu - the value returned by reading null

nullValue

public java.lang.Object nullValue()
Returns the value returned by reading null
Returns:
the value returned by reading null

add

public void add(java.lang.Object source,
                java.lang.Object target)
Maps the given source Object to its target Object.
Parameters:
source - the source Object
target - the target Object

getProperty

public java.lang.Object getProperty(java.lang.String key,
                                    java.lang.Object source,
                                    PropertyStatusReader prop)
Returns a property value with a given key using the source-object (and perhaps the given PropertyStatusReader).
Overrides:
getProperty in class SourcePropertyAdapter
Parameters:
key - the property name
source - the source object to use
prop - the PropertyStatusReader
Returns:
property value