Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.biojava.bio.symbol
Class RangeLocation

    java.lang.Object
      org.biojava.bio.symbol.AbstractLocation
          org.biojava.bio.symbol.AbstractRangeLocation
              org.biojava.bio.symbol.RangeLocation

All Implemented Interfaces:
  Serializable, Location

Direct Known Subclasses:
  MergeLocation

    public class RangeLocation

extends AbstractRangeLocation
implements Serializable

A simple implementation of Location that contains all points between getMin and getMax inclusive.

This will in practice be the most commonly used pure-java implementation.

Author:
  Matthew Pocock
See Also:
  Serialized Form

Field Summary

Fields inherited from interface org.biojava.bio.symbol.Location
`empty, full, naturalOrder`

Constructor Summary
`RangeLocation(int min, int max)` Construct a new RangeLocation from `min` to `max`.

Method Summary
`int` | `getMax()` The maximum position contained.
`int` | `getMin()` The minimum position contained.
`String` | `toString()`
`Location` | `translate(int dist)` Create a location that is a translation of this location.

Methods inherited from class org.biojava.bio.symbol.AbstractRangeLocation
`blockIterator, contains, isContiguous, symbols`

Methods inherited from class org.biojava.bio.symbol.AbstractLocation
`contains, equals, getDecorator, hashCode, intersection, newInstance, overlaps, union`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### RangeLocation

    public RangeLocation(int min,
                         int max)
                  throws IndexOutOfBoundsException

  Construct a new RangeLocation from `min` to `max`.

  Throws:
    `IndexOutOfBoundsException`

Method Detail

### getMin

    public int getMin()

  Description copied from interface: `Location`
  The minimum position contained.

  WARNING: The location will not contain every point between `getMin()` and `getMax()` if `isContiguous()` is false. If `isContiguous()` does return false you should use the `Iterator` returned by `blockIterator()` to iterate over the minimum set of contiguous blocks that make up this `Location`

  Specified by:
    `getMin` in interface `Location`
  Returns:
    the minimum position contained

### getMax

    public int getMax()

  Description copied from interface: `Location`
  The maximum position contained.

  WARNING: The location will not contain every point between `getMin()` and `getMax()` if `isContiguous()` is false. If `isContiguous()` does return false you should use the `Iterator` returned by `blockIterator()` to iterate over the minimum set of contiguous blocks that make up this `Location`

  Specified by:
    `getMax` in interface `Location`
  Returns:
    the maximum position contained

### translate

    public Location translate(int dist)

  Description copied from interface: `Location`
  Create a location that is a translation of this location.

  Specified by:
    `translate` in interface `Location`
  Parameters:
    `dist` - the distance to translate (to the right)

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD