public class IndirectMap extends Hashtable implements IndirectContainer
To use an IndirectMap:
CollectionMapping,
IndirectList,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Hashtable |
delegate
Reduce type casting
|
protected int |
initialCapacity
Store initial size for lazy init.
|
protected float |
loadFactor
Store load factor for lazy init.
|
protected ValueHolderInterface |
valueHolder
Delegate indirection behavior to a value holder
|
| Constructor and Description |
|---|
IndirectMap()
PUBLIC:
Construct a new, empty IndirectMap with a default
capacity and load factor.
|
IndirectMap(int initialCapacity)
PUBLIC:
Construct a new, empty IndirectMap with the specified initial capacity
and default load factor.
|
IndirectMap(int initialCapacity,
float loadFactor)
PUBLIC:
Construct a new, empty IndirectMap with the specified initial
capacity and load factor.
|
IndirectMap(Map m)
PUBLIC:
Construct a new IndirectMap with the same mappings as the given Map.
|
| Modifier and Type | Method and Description |
|---|---|
protected Hashtable |
buildDelegate()
Return the freshly-built delegate.
|
void |
clear() |
Object |
clone() |
boolean |
contains(Object value) |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Enumeration |
elements() |
Set |
entrySet() |
boolean |
equals(Object o) |
Object |
get(Object key) |
protected Hashtable |
getDelegate()
Check whether the contents have been read from the database.
|
String |
getTopLinkAttributeName()
Return the mapping attribute name, used to raise change events.
|
ValueHolderInterface |
getValueHolder()
PUBLIC:
Return the valueHolder.
|
int |
hashCode() |
protected void |
initialize(int initialCapacity,
float loadFactor)
Initialize the instance.
|
protected void |
initialize(Map m)
Initialize the instance.
|
boolean |
isEmpty() |
boolean |
isInstantiated()
PUBLIC:
Return whether the contents have been read from the database.
|
Enumeration |
keys() |
Set |
keySet() |
Object |
put(Object key,
Object value) |
void |
putAll(Map t) |
protected void |
raiseAddChangeEvent(Object key,
Object value)
Raise the add change event and relationship maintainence.
|
protected void |
raiseRemoveChangeEvent(Object key,
Object value)
Raise the remove change event.
|
protected void |
rehash() |
Object |
remove(Object key) |
void |
setTopLinkAttributeName(String attributeName)
Set the mapping attribute name, used to raise change events.
|
void |
setValueHolder(ValueHolderInterface valueHolder)
PUBLIC:
Set the value holder.
|
int |
size() |
String |
toString()
PUBLIC:
Use the Hashtable.toString(); but wrap it with braces to indicate
there is a bit of indirection.
|
Collection |
values() |
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllprotected Hashtable delegate
protected ValueHolderInterface valueHolder
protected int initialCapacity
protected float loadFactor
public IndirectMap()
public IndirectMap(int initialCapacity)
initialCapacity - the initial capacity of the hashtablepublic IndirectMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the hashtableloadFactor - a number between 0.0 and 1.0IllegalArgumentException - if the initial capacity is less
than or equal to zero, or if the load factor is less than
or equal to zeropublic IndirectMap(Map m)
m - a map containing the mappings to useprotected Hashtable buildDelegate()
public void clear()
clear in interface Mapclear in class HashtableHashtable.clear()public Object clone()
clone in class HashtableThis will result in a database query if necessary.public boolean contains(Object value)
contains in class HashtableHashtable.contains(java.lang.Object)public boolean containsKey(Object key)
containsKey in interface MapcontainsKey in class HashtableHashtable.containsKey(java.lang.Object)public boolean containsValue(Object value)
containsValue in interface MapcontainsValue in class HashtableHashtable.containsValue(java.lang.Object)public Enumeration elements()
elements in class HashtableHashtable.elements()public Set entrySet()
entrySet in interface MapentrySet in class HashtableHashtable.entrySet()public boolean equals(Object o)
equals in interface Mapequals in class HashtableHashtable.equals(java.lang.Object)public Object get(Object key)
get in interface Mapget in class HashtableHashtable.get(java.lang.Object)protected Hashtable getDelegate()
public String getTopLinkAttributeName()
public ValueHolderInterface getValueHolder()
getValueHolder in interface IndirectContainerpublic int hashCode()
hashCode in interface MaphashCode in class HashtableHashtable.hashCode()protected void initialize(int initialCapacity,
float loadFactor)
protected void initialize(Map m)
public boolean isEmpty()
isEmpty in interface MapisEmpty in class HashtableHashtable.isEmpty()public boolean isInstantiated()
isInstantiated in interface IndirectContainerpublic Enumeration keys()
keys in class HashtableHashtable.keys()public Set keySet()
keySet in interface MapkeySet in class HashtableHashtable.keySet()public Object put(Object key, Object value)
put in interface Mapput in class HashtableHashtable.put(java.lang.Object, java.lang.Object)public void putAll(Map t)
putAll in interface MapputAll in class HashtableHashtable.putAll(java.util.Map)protected void rehash()
rehash in class HashtableHashtable.rehash()protected void raiseAddChangeEvent(Object key, Object value)
protected void raiseRemoveChangeEvent(Object key, Object value)
public Object remove(Object key)
remove in interface Mapremove in class HashtableHashtable.remove(java.lang.Object)public void setTopLinkAttributeName(String attributeName)
public void setValueHolder(ValueHolderInterface valueHolder)
setValueHolder in interface IndirectContainerpublic int size()
size in interface Mapsize in class HashtableHashtable.size()public String toString()
toString in class HashtableHashtable.toString()public Collection values()
values in interface Mapvalues in class HashtableHashtable.values()Copyright © 2023. All rights reserved.