All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.humbleui.skija.shaper.TrivialLanguageRunIterator Maven / Gradle / Ivy

There is a newer version: 0.116.2
Show newest version
package io.github.humbleui.skija.shaper;

import java.util.*;
import org.jetbrains.annotations.*;
import io.github.humbleui.skija.*;

public class TrivialLanguageRunIterator implements Iterator {
    @ApiStatus.Internal public final int     _length;
    @ApiStatus.Internal public final String  _language;
    @ApiStatus.Internal public       boolean _atEnd;
    
    public TrivialLanguageRunIterator(String text, String language) {
        _length   = text.length();
        _language = language;
        _atEnd    = _length == 0;
    }

    @Override
    public LanguageRun next() {
        _atEnd = true;
        return new LanguageRun(_length, _language);
    }

    @Override
    public boolean hasNext() {
        return !_atEnd;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy