|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
net.wotonomy.foundation.NSDictionary
net.wotonomy.foundation.NSMutableDictionary
net.wotonomy.control.internal.Surrogate
public class Surrogate
A Surrogate is a special object that can be used in a display group when you wish to emulate other objects or modify their behaviors. Because it is a Map, it makes use of Introspector's ability to treat keys in a map as if they were properties to implement the following features.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.wotonomy.foundation.NSKeyValueCoding |
---|
net.wotonomy.foundation.NSKeyValueCoding.DefaultImplementation, net.wotonomy.foundation.NSKeyValueCoding.Null, net.wotonomy.foundation.NSKeyValueCoding.Utility |
Field Summary | |
---|---|
protected java.lang.Object |
defaultValue
|
protected java.lang.Object[] |
delegates
|
Fields inherited from class net.wotonomy.foundation.NSDictionary |
---|
EmptyDictionary |
Fields inherited from interface net.wotonomy.foundation.NSKeyValueCoding |
---|
NullValue |
Constructor Summary | |
---|---|
Surrogate()
Default constructor with no delegate object and no default value. |
|
Surrogate(java.lang.Object aDefault)
Constructor specifying a default value. |
|
Surrogate(java.lang.Object[] aDelegateArray)
Constructor specifying a delegate object. |
|
Surrogate(java.lang.Object[] aDelegateArray,
java.lang.Object aDefault)
Constructor specifying a delegate object and a default value. |
Method Summary | |
---|---|
java.lang.Object |
directGet(java.lang.Object aKey)
Called by get to retrieve a value from the internal map. |
java.lang.Object |
directPut(java.lang.Object aKey,
java.lang.Object aValue)
Called by put to retrieve a value from the internal map. |
boolean |
equals(java.lang.Object anObject)
Overridden to compare by reference. |
java.lang.Object |
get(java.lang.Object aKey)
Overridden to consult each delegate before checking the internal list of keys. |
java.lang.Object |
getDefaultValue()
Returns the current default value, or null if no default exists. |
java.lang.Object |
getDelegate()
Returns the first delegate object, or null if no delegates exist. |
java.lang.Object[] |
getDelegates()
Returns the list of delegates in the order in which they are consulted. |
java.lang.Object |
put(java.lang.Object aKey,
java.lang.Object aValue)
Overridden to attempt to write each delegate, writing to only the first successful delegate, before storing the value in the internal map. |
void |
setDefaultValue(java.lang.Object aDefault)
Sets the default value. |
void |
setDelegate(java.lang.Object aDelegate)
Sets the delegate object list to contain only the specified object. |
void |
setDelegates(java.lang.Object[] aDelegateArray)
Sets the list of delegates in the order in which they will be consulted. |
Methods inherited from class net.wotonomy.foundation.NSMutableDictionary |
---|
addEntriesFromDictionary, removeAllObjects, removeObjectForKey, removeObjectsForKeys, setDictionary, setObjectForKey |
Methods inherited from class net.wotonomy.foundation.NSDictionary |
---|
allKeys, allKeysForObject, allValues, count, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, isEqualToDictionary, keyEnumerator, objectEnumerator, objectForKey, objectsForKeys, storedValueForKey, takeStoredValueForKey, takeValueForKey, toString, unableToSetNullForKey, validateTakeValueForKeyPath, valueForKey |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
hashCode |
Field Detail |
---|
protected java.lang.Object[] delegates
protected java.lang.Object defaultValue
Constructor Detail |
---|
public Surrogate()
public Surrogate(java.lang.Object[] aDelegateArray)
public Surrogate(java.lang.Object aDefault)
public Surrogate(java.lang.Object[] aDelegateArray, java.lang.Object aDefault)
Method Detail |
---|
public java.lang.Object getDelegate()
public void setDelegate(java.lang.Object aDelegate)
public java.lang.Object[] getDelegates()
public void setDelegates(java.lang.Object[] aDelegateArray)
public java.lang.Object getDefaultValue()
public void setDefaultValue(java.lang.Object aDefault)
public java.lang.Object directGet(java.lang.Object aKey)
public java.lang.Object directPut(java.lang.Object aKey, java.lang.Object aValue)
public java.lang.Object get(java.lang.Object aKey)
get
in interface java.util.Map
get
in class java.util.HashMap
public java.lang.Object put(java.lang.Object aKey, java.lang.Object aValue)
put
in interface java.util.Map
put
in class java.util.HashMap
public boolean equals(java.lang.Object anObject)
equals
in interface java.util.Map
equals
in class java.util.AbstractMap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |