net.amygdalum.util.text.linkeddawg.LinkedCharNavigator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compilerutils Show documentation
Show all versions of compilerutils Show documentation
Utility classes needed for search and compiler applications
The newest version!
package net.amygdalum.util.text.linkeddawg;
import static net.amygdalum.util.text.CharUtils.charToString;
import net.amygdalum.util.text.CharNavigator;
import net.amygdalum.util.text.CharNode;
import net.amygdalum.util.text.WordSetNavigationException;
public class LinkedCharNavigator implements CharNavigator> {
private CharNode node;
public LinkedCharNavigator(CharNode node) {
this.node = node;
}
@Override
public LinkedCharNavigator nextNode(char c) {
node = node.nextNode(c);
if (node == null) {
throw new WordSetNavigationException("unexpected navigation to " + charToString(c));
}
return this;
}
@Override
public T getAttached() {
return node.getAttached();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy