net.amygdalum.util.text.linkeddawg.CharTerminalNode Maven / Gradle / Ivy
package net.amygdalum.util.text.linkeddawg;
import net.amygdalum.util.text.CharNode;
import net.amygdalum.util.text.NodeResolver;
public class CharTerminalNode implements CharNode {
private static final char[] NONE = new char[0];
private T attached;
private CharTerminalNode(T attached) {
this.attached = attached;
}
public static CharTerminalNode buildNodeFrom(CharNode node, NodeResolver> resolver) {
if (node.getAlternativesSize() > 0) {
return null;
}
return new CharTerminalNode<>(node.getAttached());
}
@Override
public CharNode nextNode(char c) {
return null;
}
@Override
public T getAttached() {
return attached;
}
@Override
public char[] getAlternatives() {
return NONE;
}
@Override
public int getAlternativesSize() {
return 0;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy