org.apache.tools.ant.utilClass LazyHashtable
- java.lang.Object
- java.util.Dictionary<K,V>
- java.util.Hashtable
- org.apache.tools.ant.util.LazyHashtable
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.Map
public class LazyHashtable extends java.util.Hashtable
Hashtable implementation that allows delayed construction of expensive objects All operations that need access to the full list of objects will call initAll() first. Get and put are cheap.
- Since:
- Ant 1.6
- See Also:
- Serialized Form
Field Summary
Fields Modifier and Type Field and Description protected boolean
initAllDone
Constructor Summary
Constructors Constructor and Description LazyHashtable()
No arg constructor.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
contains(java.lang.Object value)
Check if the table contains a particular value.boolean
containsKey(java.lang.Object value)
Check if the table contains a particular key.boolean
containsValue(java.lang.Object value)
Delegates tocontains
.java.util.Enumeration
elements()
Get a enumeration over the elements.protected void
initAll()
Used to be part of init.boolean
isEmpty()
Check if the table is empty.java.util.Enumeration
keys()
Get an enumeration over the keys.int
size()
Get the size of the table.
Method Detail
initAll
protected void initAll()Used to be part of init. It must be done once - but we delay it until we do need _all_ tasks. Otherwise we just get the tasks that we need, and avoid costly init.
elements
public java.util.Enumeration elements()Get a enumeration over the elements.
- Overrides:
elements
in classjava.util.Hashtable
- Returns:
- an enumeration.
isEmpty
public boolean isEmpty()Check if the table is empty.
- Specified by:
isEmpty
in interfacejava.util.Map
- Overrides:
isEmpty
in classjava.util.Hashtable
- Returns:
- true if it is.
size
public int size()Get the size of the table.
- Specified by:
size
in interfacejava.util.Map
- Overrides:
size
in classjava.util.Hashtable
- Returns:
- the size.
contains
public boolean contains(java.lang.Object value)Check if the table contains a particular value.
- Overrides:
contains
in classjava.util.Hashtable
- Parameters:
value
- the value to look for.- Returns:
- true if the table contains the value.
containsKey
public boolean containsKey(java.lang.Object value)Check if the table contains a particular key.
- Specified by:
containsKey
in interfacejava.util.Map
- Overrides:
containsKey
in classjava.util.Hashtable
- Parameters:
value
- the key to look for.- Returns:
- true if the table contains key.
containsValue
public boolean containsValue(java.lang.Object value)Delegates tocontains
.
- Specified by:
containsValue
in interfacejava.util.Map
- Overrides:
containsValue
in classjava.util.Hashtable
- Parameters:
value
- the value to look for.- Returns:
- true if the table contains the value.
keys
public java.util.Enumeration keys()Get an enumeration over the keys.
- Overrides:
keys
in classjava.util.Hashtable
- Returns:
- an enumeration.