org.bdgp.util
Class RangeHash

java.lang.Object
  |
  +--org.bdgp.util.RangeHash

public class RangeHash
extends java.lang.Object


Constructor Summary
RangeHash()
           
 
Method Summary
protected static int compare(Range a, Range b)
           
protected static boolean contains(Range r, int value)
           
protected static boolean equals(Range a, Range b)
           
 java.lang.Object get(int key)
          Returns the value whose key range contains the given key, or null if no range contains that key.
 java.util.Vector get(int low, int high)
           
 int[] getDefinedInterval()
           
 int[] getDefinedInterval(int key)
           
 double[] getInterval(int key)
           
 int getIntervalIndex(int low, int high)
           
 int getIntervalIndex(int low, int high, boolean exact)
           
 java.lang.Object getItemAtIndex(int index)
           
static void main(java.lang.String[] args)
           
protected static boolean overlaps(Range a, Range b)
           
 java.util.Vector put(int low, int high, java.lang.Object value)
           
 java.util.Vector put(Range holder, java.lang.Object value)
           
 java.util.Enumeration ranges()
           
 java.lang.Object remove(int key)
          Removes and returns the value whose key range contains the given key.
 java.lang.Object remove(int low, int high)
          Removes the EXACT range defined by (low,high).
 void removeAll()
          Removes every element
 java.util.Vector removeRange(int low, int high)
          Removes every element within the range (low,high)
 int size()
           
 java.lang.String toString()
           
 java.util.Enumeration values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeHash

public RangeHash()
Method Detail

equals

protected static boolean equals(Range a,
                                Range b)

compare

protected static int compare(Range a,
                             Range b)

contains

protected static boolean contains(Range r,
                                  int value)

overlaps

protected static boolean overlaps(Range a,
                                  Range b)

main

public static void main(java.lang.String[] args)

get

public java.util.Vector get(int low,
                            int high)

getIntervalIndex

public int getIntervalIndex(int low,
                            int high)

getIntervalIndex

public int getIntervalIndex(int low,
                            int high,
                            boolean exact)

getItemAtIndex

public java.lang.Object getItemAtIndex(int index)

getDefinedInterval

public int[] getDefinedInterval()

getDefinedInterval

public int[] getDefinedInterval(int key)

getInterval

public double[] getInterval(int key)

put

public java.util.Vector put(Range holder,
                            java.lang.Object value)

put

public java.util.Vector put(int low,
                            int high,
                            java.lang.Object value)

remove

public java.lang.Object remove(int key)
Removes and returns the value whose key range contains the given key. If there is no such value, null is returned.

remove

public java.lang.Object remove(int low,
                               int high)
Removes the EXACT range defined by (low,high). If no range is defined on exactly those coordinates, no elements are removed

removeRange

public java.util.Vector removeRange(int low,
                                    int high)
Removes every element within the range (low,high)

removeAll

public void removeAll()
Removes every element

get

public java.lang.Object get(int key)
Returns the value whose key range contains the given key, or null if no range contains that key.

values

public java.util.Enumeration values()

ranges

public java.util.Enumeration ranges()

size

public int size()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object