Skip to content

Instantly share code, notes, and snippets.

@fge
Created March 3, 2013 21:40
Show Gist options
  • Select an option

  • Save fge/5078433 to your computer and use it in GitHub Desktop.

Select an option

Save fge/5078433 to your computer and use it in GitHub Desktop.
/*
* Copyright (c) 2013, Francis Galiegue <fgaliegue@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Lesser GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.fge.jsonschema;
import java.util.Iterator;
public abstract class Range<T extends Number>
implements Iterator<T>, Iterable<T>
{
public static Range<Integer> range(final int from, final int to,
final int step)
{
return new IntegerRange(from, to, step);
}
@Override
public final void remove()
{
throw new UnsupportedOperationException();
}
@Override
public final Iterator<T> iterator()
{
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment