org.hydrateframework
Class Assembler.PrefixMap

java.lang.Object
  extended by org.hydrateframework.Assembler.PrefixMap
All Implemented Interfaces:
java.util.Map
Enclosing class:
Assembler

public static class Assembler.PrefixMap
extends java.lang.Object
implements java.util.Map

An implementation of the map interface that behaves as if it contains a value for any key supplied that is the same as the key but with a specified prefix prepended to it. For example, if the prefix is "MyName.", the call prefixMap.get("MyKey") would return "MyName.MyKey".

Author:
chamda

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
Assembler.PrefixMap(java.lang.String prefix)
           
 
Method Summary
 void clear()
          Clear has no meaning and does nothing in this implementation
 boolean containsKey(java.lang.Object key)
          In effect this implementation contains all possible keys because it can always return some kind of a value from any key.
 boolean containsValue(java.lang.Object value)
          In effect this implementation contains all possible String values that begin with this instance's prefix.
 java.util.Set entrySet()
          Since the entry set is in effect infinite, this method returns null.
 java.lang.Object get(java.lang.Object key)
          This method actually returns the toString value for the key object prefixed with this instance's prefix string.
 boolean isEmpty()
           
 java.util.Set keySet()
          Since the entry set is in effect infinite, this method returns null.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          This method does nothing.
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
 int size()
          Since the entry set size is in effect infinite, this method returns the largest possible integer.
 java.util.Collection values()
          Since the entry set size is in effect infinite, this method returns null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

Assembler.PrefixMap

public Assembler.PrefixMap(java.lang.String prefix)
Method Detail

clear

public void clear()
Clear has no meaning and does nothing in this implementation

Specified by:
clear in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
In effect this implementation contains all possible keys because it can always return some kind of a value from any key. So this method always returns true.

Specified by:
containsKey in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
In effect this implementation contains all possible String values that begin with this instance's prefix.

Specified by:
containsValue in interface java.util.Map

entrySet

public java.util.Set entrySet()
Since the entry set is in effect infinite, this method returns null.

Specified by:
entrySet in interface java.util.Map

get

public java.lang.Object get(java.lang.Object key)
This method actually returns the toString value for the key object prefixed with this instance's prefix string.

Specified by:
get in interface java.util.Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map

keySet

public java.util.Set keySet()
Since the entry set is in effect infinite, this method returns null.

Specified by:
keySet in interface java.util.Map

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
This method does nothing.

Specified by:
put in interface java.util.Map

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map

size

public int size()
Since the entry set size is in effect infinite, this method returns the largest possible integer.

Specified by:
size in interface java.util.Map

values

public java.util.Collection values()
Since the entry set size is in effect infinite, this method returns null

Specified by:
values in interface java.util.Map


Copyright © 2000 The Hydrate Project. All Rights Reserved.