FileDocCategorySizeDatePackage
LazyHashtable.javaAPI DocApache Ant 1.703347Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.util

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

Fields Summary
protected boolean
initAllDone
Constructors Summary
public LazyHashtable()
No arg constructor.

    // CheckStyle:VisibilityModifier OFF - bc

        
      
        super();
    
Methods Summary
public booleancontains(java.lang.Object value)
Check if the table contains a particular value.

param
value the value to look for.
return
true if the table contains the value.

        initAll();
        return super.contains(value);
    
public booleancontainsKey(java.lang.Object value)
Check if the table contains a particular key.

param
value the key to look for.
return
true if the table contains key.

        initAll();
        return super.containsKey(value);
    
public booleancontainsValue(java.lang.Object value)
Delegates to {@link #contains contains}.

param
value the value to look for.
return
true if the table contains the value.

        return contains(value);
    
public java.util.Enumerationelements()
Get a enumeration over the elements.

return
an enumeration.

        initAll();
        return super.elements();
    
protected voidinitAll()
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.

        if (initAllDone) {
            return;
        }
        initAllDone = true;
    
public booleanisEmpty()
Check if the table is empty.

return
true if it is.

        initAll();
        return super.isEmpty();
    
public java.util.Enumerationkeys()
Get an enumeration over the keys.

return
an enumeration.

        initAll();
        return super.keys();
    
public intsize()
Get the size of the table.

return
the size.

        initAll();
        return super.size();