com.cmpware.elf.dwarf2
Class RangeLookupList

java.lang.Object
  extended by com.cmpware.elf.dwarf2.RangeLookupList
Direct Known Subclasses:
LocationList

public class RangeLookupList
extends java.lang.Object

This class is used to manage data to be looked up by a range, often an address range. This class currently does little error checking, and behavior is undefined in situations where ranges overlap.

Copyright (c) 2007 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Nested Class Summary
 class RangeLookupList.RangeEntry
          This class describes a range entry.
 
Field Summary
static java.lang.String copyright
          Copyright string
protected  java.util.ArrayList l
          The sorted range list
protected  com.cmpware.elf.dwarf2.RangeLookupList.RangeStartCompare rangeStartComparator
          A Range Start comparator class to sort range entries by range start
 
Constructor Summary
RangeLookupList()
           
 
Method Summary
 java.lang.Object get(int i)
          This method returns element i in the Range Lookup list.
 java.lang.Object lookup(long i)
          This method returns the object associated with the given range.
 void put(long rangeStart, long rangeEnd, java.lang.Object o)
          This method adds a new object to the range lookup list.
 int size()
          This method returns the number of elements in this range lookup list.
 java.lang.String toString()
          This method retuns a string representation of the range lookup list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

rangeStartComparator

protected com.cmpware.elf.dwarf2.RangeLookupList.RangeStartCompare rangeStartComparator
A Range Start comparator class to sort range entries by range start


l

protected java.util.ArrayList l
The sorted range list

Constructor Detail

RangeLookupList

public RangeLookupList()
Method Detail

put

public void put(long rangeStart,
                long rangeEnd,
                java.lang.Object o)
This method adds a new object to the range lookup list. This value will be returned when a lookup of a value in the range between the values low and high (inclusive) is performed.

Parameters:
rangeStart - the low range value for the lookup.
rangeEnd - the high range value for the lookup.
o - the object returned by the lookup.

lookup

public java.lang.Object lookup(long i)
This method returns the object associated with the given range. If no range is found, null is returned.

Parameters:
i - the value to be search for.
Returns:
This method returns the object associated with the given range. If no range is found, null is returned.

size

public int size()
This method returns the number of elements in this range lookup list.

Returns:
This method returns the number of elements in this range lookup list.

get

public java.lang.Object get(int i)
This method returns element i in the Range Lookup list.

Parameters:
i - the index.
Returns:
This method returns element i in the Range Lookup list.

toString

public java.lang.String toString()
This method retuns a string representation of the range lookup list.

Overrides:
toString in class java.lang.Object
Returns:
This method retuns a string representation of the range lookup list.