This is used to wrap the key objects used in caches that are name space aware, such
as JBossCache. The NameSpaceKey object is returned from queries as the key object in the result map.
There is an implicit ordering by nameSpace and then by the key.
The ordering is defined by (as pseudocode)
if nameSpace instance of comparable && namespace.class == other.class
then use namespace.compareTo(other)
else use comparison of namespace.toString().compareTo(other.toString()).
So for namespaces that are the same type and implement comparable then
a correct ordering will occur otherwise you will get a lexical ordering
based on the toString() method.
It is recommended that you use namspaces that are the same type.
The keys are compared in a similar manner.
author: Steve Woodcock
version: 1.5 |