org.apache.tools.ant.util

Class LazyHashtable

public class LazyHashtable extends 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

Field Summary
protected booleaninitAllDone
Constructor Summary
LazyHashtable()
No arg constructor.
Method Summary
booleancontains(Object value)
Check if the table contains a particular value.
booleancontainsKey(Object value)
Check if the table contains a particular key.
booleancontainsValue(Object value)
Delegates to {@link #contains contains}.
Enumerationelements()
Get a enumeration over the elements.
protected voidinitAll()
Used to be part of init.
booleanisEmpty()
Check if the table is empty.
Enumerationkeys()
Get an enumeration over the keys.
intsize()
Get the size of the table.

Field Detail

initAllDone

protected boolean initAllDone

Constructor Detail

LazyHashtable

public LazyHashtable()
No arg constructor.

Method Detail

contains

public boolean contains(Object value)
Check if the table contains a particular value.

Parameters: value the value to look for.

Returns: true if the table contains the value.

containsKey

public boolean containsKey(Object value)
Check if the table contains a particular key.

Parameters: value the key to look for.

Returns: true if the table contains key.

containsValue

public boolean containsValue(Object value)
Delegates to {@link #contains contains}.

Parameters: value the value to look for.

Returns: true if the table contains the value.

elements

public Enumeration elements()
Get a enumeration over the elements.

Returns: an enumeration.

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.

isEmpty

public boolean isEmpty()
Check if the table is empty.

Returns: true if it is.

keys

public Enumeration keys()
Get an enumeration over the keys.

Returns: an enumeration.

size

public int size()
Get the size of the table.

Returns: the size.