jdsl.core.api
Interface InspectableOrderedDictionary
- All Superinterfaces:
- InspectableContainer, InspectableDictionary, InspectableKeyBasedContainer
- All Known Subinterfaces:
- OrderedDictionary
- public interface InspectableOrderedDictionary
- extends InspectableDictionary
A read-only lookup structure in which an ordering of the keys is
maintained; please refer to the documentation of OrderedDictionary
for more details.
- Version:
- $Id: InspectableOrderedDictionary.java,v 1.8 2000/12/18 19:50:27 lv Exp $
- Author:
- Mark Handy, Luca Vismara, Andrew Schwerin
- See Also:
OrderedDictionary
,
InspectableDictionary
Field Summary |
static Locator |
BOUNDARY_VIOLATION
Object returned from all four methodsof
InspectableOrderedDictionary to indicate that the user tried to
access before the first element of the dictionary or after the
last. |
Method Summary |
Locator |
after(Locator locator)
Returns the Locator that is sequentially after another Locator in
this Container. |
Locator |
before(Locator locator)
Returns the Locator that is sequentially before another Locator
in this Container. |
Locator |
closestAfter(java.lang.Object key)
Returns the locator with smallest key greater than or equal to
the search key. |
Locator |
closestBefore(java.lang.Object key)
Returns the locator with largest key less than or equal to the
search key. |
Locator |
first()
Returns the Locator that is sequentially before any other Locator
in this Container. |
Locator |
last()
Returns the Locator that is sequentially after any other Locator
in this Container. |
BOUNDARY_VIOLATION
public static final Locator BOUNDARY_VIOLATION
- Object returned from all four methodsof
InspectableOrderedDictionary to indicate that the user tried to
access before the first element of the dictionary or after the
last. Note that dictionaries have special values returned from
lookup methods, rather than exceptions, when the lookup fails.
before
public Locator before(Locator locator)
throws InvalidAccessorException
- Returns the Locator that is sequentially before another Locator
in this Container. If there is no such element then the returned
Locator will be invalid.
- Parameters:
locator
- An abstract position in this Container.- Returns:
- A Locator which is sequentially before
locator
. Note: Will return the invalid
BOUNDARY_VIOLATION Locator if no such locator exists. - Throws:
InvalidAccessorException
- If locator
is
invalid (For example: It does not actually reference an element
within this Container).
after
public Locator after(Locator locator)
throws InvalidAccessorException
- Returns the Locator that is sequentially after another Locator in
this Container. If there is no such element then the returned
Locator will be invalid.
- Parameters:
locator
- An abstract position in this Container.- Returns:
- A Locator which is sequentially after
locator
. Note: Will return the invalid
BOUNDARY_VIOLATION Locator if no such locator exists. - Throws:
InvalidAccessorException
- If locator
is
invalid (For example: It does not actually reference an element
within this Container).
closestBefore
public Locator closestBefore(java.lang.Object key)
throws InvalidKeyException
- Returns the locator with largest key less than or equal to the
search key. There may exist more than one locator satisfying
this property; which one is returned is implementation dependent.
- Parameters:
key
- A valid key.- Returns:
- The locator with largest key less than or equal to
key
. Note: If no such locator exists, the
returned locator will be BOUNDARY_VIOLATION. - Throws:
InvalidKeyException
- If key
is not of a
type accepted by this Container (For example: the key is not
comparable).
closestAfter
public Locator closestAfter(java.lang.Object key)
throws InvalidKeyException
- Returns the locator with smallest key greater than or equal to
the search key. There may exist more than one locator satisfying
this property; which one is returned is implementation dependent.
- Parameters:
key
- A valid key.- Returns:
- The locator with smallest key greater than or equal to
key
. Note: If no such Locator exists, the
returned locator will be BOUNDARY_VIOLATION. - Throws:
InvalidKeyException
- If key
is not of a
type accepted by this Container (For example: the key is not
comparable).
first
public Locator first()
- Returns the Locator that is sequentially before any other Locator
in this Container. If there is no such element then the returned
Locator will be invalid.
- Returns:
- A Locator which is sequentially before any other
locator. Note: Will return the invalid BOUNDARY_VIOLATION
Locator if no such locator exists.
last
public Locator last()
- Returns the Locator that is sequentially after any other Locator
in this Container. If there is no such element then the returned
Locator will be invalid.
- Returns:
- A Locator which is sequentially after any other
locator. Note: Will return the invalid BOUNDARY_VIOLATION
Locator if no such locator exists.