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.apache.sandesha2.util
Class RangeString

    java.lang.Object
      org.apache.sandesha2.util.RangeString

All Implemented Interfaces:
  java.io.Serializable

    public class RangeString

extends java.lang.Object
implements java.io.Serializable

Helper class. Enables conversion to from a list of Range objects to a String representation of that list. Also performs task such as aggregation of ranges

See Also:
  Serialized Form

Constructor Summary
`RangeString()` Creates an empty range string
`RangeString(RangeString rs)`
`RangeString(java.lang.String s)` Expects a String of the form [x1,y1][x2,y2]...[xn,yn]

Method Summary
`RangeString` | `addRange(Range r)` Adds the Range into the existing RangeString Any existing Ranges that are encompassed in this new Range are removed.
`static RangeString` | `clone(RangeString original)`
`boolean` | `equals(java.lang.Object o)`
`java.util.List<java.lang.Long>` | `getContainedElementsAsNumbersList()` Returns a List of the form [x1,x2,x3....xn] listing each discrete number contained in all of the ranges in order NOTE: inefficient, should be avoided
`Range` | `getRangeForMessageNumber(long messageNumber)`
`Range[]` | `getRanges()`
`boolean` | `isMessageNumberInRanges(long messageNumber)`
`boolean` | `isRangeCompleted(Range interestedRange)` Returns true if the numbers are contained in a single range
`java.lang.String` | `toString()`

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

Constructor Detail

### RangeString

    public RangeString()

  Creates an empty range string

### RangeString

    public RangeString(java.lang.String s)

  Expects a String of the form [x1,y1][x2,y2]...[xn,yn]

  Parameters:
    `s` -

### RangeString

    public RangeString(RangeString rs)

Method Detail

### isMessageNumberInRanges

    public boolean isMessageNumberInRanges(long messageNumber)

### getRangeForMessageNumber

    public Range getRangeForMessageNumber(long messageNumber)

### isRangeCompleted

    public boolean isRangeCompleted(Range interestedRange)

  Returns true if the numbers are contained in a single range

  Parameters:
    `interestedRange` -
  Returns:

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### getRanges

    public Range[] getRanges()

  Returns:
    ordered array of each range object in the string

### getContainedElementsAsNumbersList

    public java.util.List<java.lang.Long> getContainedElementsAsNumbersList()

  Returns a List of the form [x1,x2,x3....xn] listing each discrete number contained in all of the ranges in order NOTE: inefficient, should be avoided

### clone

    public static RangeString clone(RangeString original)

### addRange

    public RangeString addRange(Range r)

  Adds the Range into the existing RangeString Any existing Ranges that are encompassed in this new Range are removed. Any existing Ranges that are on either side of this Range (i.e. if this Range plugs a gap) are joined. The method returns a RangeString consisting of all the Ranges that were added that were not present previously i.e. all the new Ranges

  Parameters:
    `r` -
  Returns:

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.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

Copyright © 2007 Apache Web Services Project. All Rights Reserved.