P-Grid v2.0a2 API Specification

p2p.basic
Interface KeyRange


public interface KeyRange

Represents a part of the key space, for example, the keys a node is responsible for. It may be used both for range or prefix-based addressing.


Method Summary
 Key getMax()
          Get the upper bound of the key range.
 Key getMin()
          Get the lower bound of the key range.
 boolean withinRange(Key key)
          Check whether key is inside the range.
 

Method Detail

getMin

Key getMin()
Get the lower bound of the key range.

Returns:
the first key in the range

getMax

Key getMax()
Get the upper bound of the key range.

Returns:
the last key in the range

withinRange

boolean withinRange(Key key)
Check whether key is inside the range.

Parameters:
key - the key to test
Returns:
true if key is inside the key range, false otherwise

P-Grid v2.0a2 API Specification

This is open source software distributed under the terms of the GNU General Public License, a copy of which is included in the file LICENSE. If not you can find the GPL at http://www.gnu.org/copyleft/gpl.txt