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

net.amygdalum.util.text.linkeddawg.LinkedByteNavigator Maven / Gradle / Ivy

The newest version!
package net.amygdalum.util.text.linkeddawg;

import net.amygdalum.util.text.ByteNavigator;
import net.amygdalum.util.text.ByteNode;
import net.amygdalum.util.text.WordSetNavigationException;

public class LinkedByteNavigator implements ByteNavigator> {

	private ByteNode node;

	public LinkedByteNavigator(ByteNode node) {
		this.node = node;
	}

	@Override
	public LinkedByteNavigator nextNode(byte b) {
		node = node.nextNode(b);
		if (node == null) {
			throw new WordSetNavigationException("unexpected navigation to " + b);
		}
		return this;
	}

	@Override
	public T getAttached() {
		return node.getAttached();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy