com.google.security.fences.util.CountingIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fences-maven-enforcer-rule Show documentation
Show all versions of fences-maven-enforcer-rule Show documentation
Augments Java's access control by checking that a Maven Project and all its
dependencies conform to a policy that specifies which classes/packages can
link to which others.
package com.google.security.fences.util;
import java.util.Iterator;
import com.google.common.base.Preconditions;
/**
* Each integer between two end-points in natural order once.
*/
public final class CountingIterable implements Iterable {
private final int leftInclusive;
private final int rightExclusive;
CountingIterable(int leftInclusive, int rightExclusive) {
Preconditions.checkArgument(leftInclusive <= rightExclusive);
this.leftInclusive = leftInclusive;
this.rightExclusive = rightExclusive;
}
public Iterator iterator() {
return new CountingIterator(leftInclusive, rightExclusive);
}
@Override
public String toString() {
return "[" + leftInclusive + ".." + rightExclusive + ")";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy