public class IndirectMap extends Hashtable implements IndirectContainer
To use an IndirectMap:
CollectionMapping
,
IndirectList
,
Serialized FormModifier 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, replaceAll
protected 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 Map
clear
in class Hashtable
Hashtable.clear()
public Object clone()
clone
in class Hashtable
This will result in a database query if necessary.
public boolean contains(Object value)
contains
in class Hashtable
Hashtable.contains(java.lang.Object)
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in class Hashtable
Hashtable.containsKey(java.lang.Object)
public boolean containsValue(Object value)
containsValue
in interface Map
containsValue
in class Hashtable
Hashtable.containsValue(java.lang.Object)
public Enumeration elements()
elements
in class Hashtable
Hashtable.elements()
public Set entrySet()
entrySet
in interface Map
entrySet
in class Hashtable
Hashtable.entrySet()
public boolean equals(Object o)
equals
in interface Map
equals
in class Hashtable
Hashtable.equals(java.lang.Object)
public Object get(Object key)
get
in interface Map
get
in class Hashtable
Hashtable.get(java.lang.Object)
protected Hashtable getDelegate()
public String getTopLinkAttributeName()
public ValueHolderInterface getValueHolder()
getValueHolder
in interface IndirectContainer
public int hashCode()
hashCode
in interface Map
hashCode
in class Hashtable
Hashtable.hashCode()
protected void initialize(int initialCapacity, float loadFactor)
protected void initialize(Map m)
public boolean isEmpty()
isEmpty
in interface Map
isEmpty
in class Hashtable
Hashtable.isEmpty()
public boolean isInstantiated()
isInstantiated
in interface IndirectContainer
public Enumeration keys()
keys
in class Hashtable
Hashtable.keys()
public Set keySet()
keySet
in interface Map
keySet
in class Hashtable
Hashtable.keySet()
public Object put(Object key, Object value)
put
in interface Map
put
in class Hashtable
Hashtable.put(java.lang.Object, java.lang.Object)
public void putAll(Map t)
putAll
in interface Map
putAll
in class Hashtable
Hashtable.putAll(java.util.Map)
protected void rehash()
rehash
in class Hashtable
Hashtable.rehash()
protected void raiseAddChangeEvent(Object key, Object value)
protected void raiseRemoveChangeEvent(Object key, Object value)
public Object remove(Object key)
remove
in interface Map
remove
in class Hashtable
Hashtable.remove(java.lang.Object)
public void setTopLinkAttributeName(String attributeName)
public void setValueHolder(ValueHolderInterface valueHolder)
setValueHolder
in interface IndirectContainer
public int size()
size
in interface Map
size
in class Hashtable
Hashtable.size()
public String toString()
toString
in class Hashtable
Hashtable.toString()
public Collection values()
values
in interface Map
values
in class Hashtable
Hashtable.values()
Copyright © 2021. All rights reserved.