sdlip.helpers
Class RangeEnumerator

java.lang.Object
  |
  +--sdlip.helpers.RangeEnumerator

public class RangeEnumerator
extends java.lang.Object

Enumerates integers using one-based selection. Examples: "1-" all positive integers "1,3-5,7" = "1,3,4,5,7"


Constructor Summary
RangeEnumerator(java.lang.String selection)
           
 
Method Summary
 int get()
          Gets the current position -1: invalid position
static void main(java.lang.String[] args)
           
 boolean next()
          moves the pointer to the next position false if no more
 void set(int nv)
          Sets the current position
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeEnumerator

public RangeEnumerator(java.lang.String selection)
Method Detail

next

public boolean next()
moves the pointer to the next position false if no more

get

public int get()
Gets the current position -1: invalid position

set

public void set(int nv)
Sets the current position

toString

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

main

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