net.amygdalum.util.text.linkeddawg.ByteGenericFallbackNode 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 net.amygdalum.util.map.ByteObjectMap;
import net.amygdalum.util.text.AttachmentAdaptor;
import net.amygdalum.util.text.ByteConnectionAdaptor;
import net.amygdalum.util.text.ByteFallbackAdaptor;
import net.amygdalum.util.text.ByteNode;
public class ByteGenericFallbackNode implements ByteNode, ByteConnectionAdaptor, AttachmentAdaptor, ByteFallbackAdaptor {
private ByteObjectMap> nexts;
private ByteNode fallback;
private T attached;
public ByteGenericFallbackNode() {
this.nexts = new ByteObjectMap>(null);
}
@Override
public void addNextNode(byte b, ByteNode node) {
nexts.put(b, node);
}
@Override
public ByteNode nextNode(byte b) {
return nexts.get(b);
}
@Override
public byte[] getAlternatives() {
return nexts.keys();
}
@Override
public int getAlternativesSize() {
return nexts.size();
}
@Override
public void attach(T attached) {
this.attached = attached;
}
@Override
public T getAttached() {
return attached;
}
@Override
public ByteNode getFallback() {
return fallback;
}
@Override
public void setFallback(ByteNode fallbackNode) {
this.fallback = fallbackNode;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy