org.opensaml.xml.util
Class IDIndex

java.lang.Object
  extended by org.opensaml.xml.util.IDIndex

@NotThreadSafe
public class IDIndex
extends Object

Class which provides storage for the ID-to-XMLObject index mapping on an owning XMLObject.


Constructor Summary
IDIndex(XMLObject newOwner)
          Constructor.
 
Method Summary
 void deregisterIDMapping(String id)
          Deregister an ID-to-XMLObject mapping for one of this object's owner's children.
 void deregisterIDMappings(IDIndex idIndex)
          Deregister multiple ID-to-XMLObject mappings for this object's owner's children.
protected  Map<String,XMLObject> getIDMappings()
          Get the ID-to-XMLObject mappings for this object's object's owner's children.
 Set<String> getIDs()
          Get the set of ID strings which are the index keys.
 boolean isEmpty()
          Return whether the index is currently empty.
 XMLObject lookup(String id)
          Lookup and return the XMLObject identified by the specified ID attribute.
 void registerIDMapping(String id, XMLObject referent)
          Register an ID-to-XMLObject mapping for one of this object's owner's children.
 void registerIDMappings(IDIndex idIndex)
          Register multiple ID-to-XMLObject mappings for this object's owner's children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDIndex

public IDIndex(XMLObject newOwner)
        throws NullPointerException
Constructor.

Parameters:
newOwner - the XMLObject which owns this ID-to-XMLObject index
Throws:
NullPointerException - thrown if the given XMLObject is null
Method Detail

registerIDMapping

public void registerIDMapping(String id,
                              XMLObject referent)
Register an ID-to-XMLObject mapping for one of this object's owner's children.

Parameters:
id - the XMLObject child's ID attribute value
referent - the XMLObject child

registerIDMappings

public void registerIDMappings(IDIndex idIndex)
Register multiple ID-to-XMLObject mappings for this object's owner's children.

Parameters:
idIndex - the ID-to-XMLObject mapping to register

deregisterIDMapping

public void deregisterIDMapping(String id)
Deregister an ID-to-XMLObject mapping for one of this object's owner's children.

Parameters:
id - the ID attribute value of the XMLObject child to deregister

deregisterIDMappings

public void deregisterIDMappings(IDIndex idIndex)
Deregister multiple ID-to-XMLObject mappings for this object's owner's children.

Parameters:
idIndex - the ID-to-XMLObject mappings to deregister

lookup

public XMLObject lookup(String id)
Lookup and return the XMLObject identified by the specified ID attribute.

Parameters:
id - the ID attribute value to lookup
Returns:
the XMLObject identified by the ID attribute value

isEmpty

public boolean isEmpty()
Return whether the index is currently empty.

Returns:
true if the index is currently empty

getIDs

public Set<String> getIDs()
Get the set of ID strings which are the index keys.

Returns:
the set of ID strings which are keys to the index

getIDMappings

protected Map<String,XMLObject> getIDMappings()
Get the ID-to-XMLObject mappings for this object's object's owner's children.

Returns:
the ID-to-XMLObject mapping


Copyright © 2006-2011 Internet2. All Rights Reserved.