org.quattor.pan.template
Class IteratorMap

java.lang.Object
  extended by org.quattor.pan.template.IteratorMap

public class IteratorMap
extends java.lang.Object

This class contains a map that holds the currently used iterators. The system hash code value of the resource is used as the key into the map. Only one iterator can be used for a given resource at a time.

Author:
loomis

Constructor Summary
IteratorMap()
          Create an instance that contains no iterator mappings initially.
 
Method Summary
 Resource.Iterator get(Resource resource)
          Lookup the iterator associated with the given resource.
 void put(Resource resource, Resource.Iterator iterator)
          Associate the iterator to the given resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IteratorMap

public IteratorMap()
Create an instance that contains no iterator mappings initially.

Method Detail

get

public Resource.Iterator get(Resource resource)
Lookup the iterator associated with the given resource. If there is no iterator, null is returned.

Parameters:
resource - resource to use for lookup
Returns:
Resource.Iterator iterator associated with given resource or null if no mapping exists

put

public void put(Resource resource,
                Resource.Iterator iterator)
Associate the iterator to the given resource. If the iterator is null, then the mapping is removed.

Parameters:
resource - resource to associate the iterator to
iterator - iterator to associate to the resource; if null mapping is removed


Copyright © 2011 Quattor. All Rights Reserved.