org.apache.hadoop.conf
Class Configuration.IntegerRanges

java.lang.Object
  extended by org.apache.hadoop.conf.Configuration.IntegerRanges
All Implemented Interfaces:
Iterable<Integer>
Enclosing class:
Configuration

public static class Configuration.IntegerRanges
extends Object
implements Iterable<Integer>

A class that represents a set of positive integer ranges. It parses strings of the form: "2-3,5,7-" where ranges are separated by comma and the lower/upper bounds are separated by dash. Either the lower or upper bound may be omitted meaning all values up to or over. So the string above means 2, 3, 5, and 7, 8, 9, ...


Constructor Summary
Configuration.IntegerRanges()
           
Configuration.IntegerRanges(String newValue)
           
 
Method Summary
 boolean isEmpty()
           
 boolean isIncluded(int value)
          Is the given value in the set of ranges
 Iterator<Integer> iterator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Configuration.IntegerRanges

public Configuration.IntegerRanges()

Configuration.IntegerRanges

public Configuration.IntegerRanges(String newValue)
Method Detail

isIncluded

public boolean isIncluded(int value)
Is the given value in the set of ranges

Parameters:
value - the value to check
Returns:
is the value in the ranges?

isEmpty

public boolean isEmpty()
Returns:
true if there are no values in this range, else false.

toString

public String toString()
Overrides:
toString in class Object

iterator

public Iterator<Integer> iterator()
Specified by:
iterator in interface Iterable<Integer>


Copyright © 2012 Apache Software Foundation. All Rights Reserved.