2
* The contects of this file is in the Public Domain.
4
* Created by Gustav Hartivgsson.
6
[CCode (cname = "V", cprefix = "v_")]
8
[CCode (cname = "VRangeIterator", cprefix = "v_range_iterator_")]
9
public class RangeIterator {
12
public RangeIterator (Range range) {
14
this.current = this.range.start;
21
if (!this.range.reverse) {
22
if (this.current <= this.range.end) {
27
if (this.current >= this.range.end){
34
public bool has_next () {
35
return (this.current < this.range.end);
39
[CCode (cname = "VRange", cprefix = "v_range_")]
41
public bool reverse {get; private set;}
42
public int start {get; private set;}
43
public int end {get; private set;}
45
public Range (int start, int end) {
55
public Type element_type () {
59
public RangeIterator iterator () {
60
return new RangeIterator (this);