org.jbind.xml.core.base
Interface IKeyStore

All Known Implementing Classes:
KeyStore

public interface IKeyStore

Stores the keys collected by unique and key constraints of elements. The keys are collected when a data tree is validated. The keys are propagated from the "leaves" of the structure towards the root.


Method Summary
 void addKeys(IRef aRef, java.util.Collection aKeys)
          Adds a collection of keys to an index.
 boolean contains(IRef aRef, IKey aKey)
          Checks if a key is contained in the key store.
 java.util.Map getAmbiguousKeySets()
          Gets the map of ambiguous key sets contained in this key store.
 java.util.Map getKeySets()
          Gets the map of key sets contained in this key store.
 boolean isAmbiguous(IRef aRef, IKey aKey)
          Checks if a key is ambiguous in the key store.
 void merge(IKeyStore aKeyStore)
          Merge keys from a child into this key store.
 

Method Detail

getKeySets

public java.util.Map getKeySets()
Gets the map of key sets contained in this key store. The map maps references of indices to sets of keys. The sets do not contain ambiguous keys.

Returns:
(optional).

getAmbiguousKeySets

public java.util.Map getAmbiguousKeySets()
Gets the map of ambiguous key sets contained in this key store. The map maps references of indices to sets of keys. Ambigous keys can occur when the keys of two key stores are merged. This is not an error as long as the key is not referred by a keyref constraint.

Returns:
(optional).

merge

public void merge(IKeyStore aKeyStore)
Merge keys from a child into this key store.

Parameters:
aKeyStore - (required).

addKeys

public void addKeys(IRef aRef,
                    java.util.Collection aKeys)
Adds a collection of keys to an index.

Parameters:
aRef - (required). An index reference.
aKeys - (required).

contains

public boolean contains(IRef aRef,
                        IKey aKey)
Checks if a key is contained in the key store.

Parameters:
aRef - (required). An index referenced.
aKey - (required).
Returns:
Returns true iff the key is contained in the key store (and not ambiguous).

isAmbiguous

public boolean isAmbiguous(IRef aRef,
                           IKey aKey)
Checks if a key is ambiguous in the key store.

Parameters:
aRef - (required). An index referenced.
aKey - (required).
Returns:
Returns true iff the key is ambiguous, i.e. was added several times to the store.