com.codemettle.akkasolr.util.LongIterator.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of akka-solr_2.12 Show documentation
Show all versions of akka-solr_2.12 Show documentation
Solr HTTP client using Akka and Spray
The newest version!
/*
* LongIterator.scala
*
* Updated: Sep 19, 2014
*
* Copyright (c) 2014, CodeMettle
*/
package com.codemettle.akkasolr.util
import scala.collection.Iterator
/**
* Copied from scala's Iterator
*
* @author Martin Odersky
* @author Matthias Zenger
*
*/
object LongIterator {
def from(start: Long): Iterator[Long] = from(start, 1)
// AbstractIterator is private in 2.10
def from(start: Long, step: Long): Iterator[Long] = new /*Abstract*/Iterator[Long] {
private var i = start
def hasNext: Boolean = true
def next(): Long = { val result = i; i += step; result }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy