public void addArc(int label, Node target) { assert label >= 0; assert numArcs == 0 || label > arcs[numArcs-1].label: "arc[-1].label=" + arcs[numArcs-1].label + " new label=" + label + " numArcs=" + numArcs; if (numArcs == arcs.length) { @SuppressWarnings({"rawtypes","unchecked"}) final Arc<T>[] newArcs = new Arc[ArrayUtil.oversize(numArcs+1, RamUsageEstimator.NUM_BYTES_OBJECT_REF)]; System.arraycopy(arcs, 0, newArcs, 0, arcs.length); for(int arcIdx=numArcs;arcIdx<newArcs.length;arcIdx++) { newArcs[arcIdx] = new Arc<>(); } arcs = newArcs; } final Arc<T> arc = arcs[numArcs++]; arc.label = label; arc.target = target; arc.output = arc.nextFinalOutput = owner.NO_OUTPUT; arc.isFinal = false; }
public void addArc(int label, Node target) { assert label >= 0; assert numArcs == 0 || label > arcs[numArcs-1].label: "arc[-1].label=" + arcs[numArcs-1].label + " new label=" + label + " numArcs=" + numArcs; if (numArcs == arcs.length) { @SuppressWarnings({"rawtypes","unchecked"}) final Arc<T>[] newArcs = new Arc[ArrayUtil.oversize(numArcs+1, RamUsageEstimator.NUM_BYTES_OBJECT_REF)]; System.arraycopy(arcs, 0, newArcs, 0, arcs.length); for(int arcIdx=numArcs;arcIdx<newArcs.length;arcIdx++) { newArcs[arcIdx] = new Arc<>(); } arcs = newArcs; } final Arc<T> arc = arcs[numArcs++]; arc.label = label; arc.target = target; arc.output = arc.nextFinalOutput = owner.NO_OUTPUT; arc.isFinal = false; }
public void addArc(int label, Node target) { assert label >= 0; assert numArcs == 0 || label > arcs[numArcs-1].label: "arc[-1].label=" + arcs[numArcs-1].label + " new label=" + label + " numArcs=" + numArcs; if (numArcs == arcs.length) { final Arc<T>[] newArcs = ArrayUtil.grow(arcs, numArcs+1); for(int arcIdx=numArcs;arcIdx<newArcs.length;arcIdx++) { newArcs[arcIdx] = new Arc<>(); } arcs = newArcs; } final Arc<T> arc = arcs[numArcs++]; arc.label = label; arc.target = target; arc.output = arc.nextFinalOutput = owner.NO_OUTPUT; arc.isFinal = false; }
/** * @param depth * The node's depth starting from the automaton root. Needed for * LUCENE-2934 (node expansion based on conditions other than the * fanout size). */ @SuppressWarnings({"rawtypes","unchecked"}) public UnCompiledNode(Builder<T> owner, int depth) { this.owner = owner; arcs = (Arc<T>[]) new Arc[1]; arcs[0] = new Arc<>(); output = owner.NO_OUTPUT; this.depth = depth; }
/** * @param depth * The node's depth starting from the automaton root. Needed for * LUCENE-2934 (node expansion based on conditions other than the * fanout size). */ @SuppressWarnings({"rawtypes","unchecked"}) public UnCompiledNode(Builder<T> owner, int depth) { this.owner = owner; arcs = (Arc<T>[]) new Arc[1]; arcs[0] = new Arc<>(); output = owner.NO_OUTPUT; this.depth = depth; }
/** * @param depth * The node's depth starting from the automaton root. Needed for * LUCENE-2934 (node expansion based on conditions other than the * fanout size). */ @SuppressWarnings({"rawtypes","unchecked"}) public UnCompiledNode(Builder<T> owner, int depth) { this.owner = owner; arcs = (Arc<T>[]) new Arc[1]; arcs[0] = new Arc<>(); output = owner.NO_OUTPUT; this.depth = depth; }
public void addArc(int label, Node target) { assert label >= 0; assert numArcs == 0 || label > arcs[numArcs-1].label: "arc[-1].label=" + arcs[numArcs-1].label + " new label=" + label + " numArcs=" + numArcs; if (numArcs == arcs.length) { final Arc<T>[] newArcs = ArrayUtil.grow(arcs, numArcs+1); for(int arcIdx=numArcs;arcIdx<newArcs.length;arcIdx++) { newArcs[arcIdx] = new Arc<>(); } arcs = newArcs; } final Arc<T> arc = arcs[numArcs++]; arc.label = label; arc.target = target; arc.output = arc.nextFinalOutput = owner.NO_OUTPUT; arc.isFinal = false; }
/** * @param depth * The node's depth starting from the automaton root. Needed for * LUCENE-2934 (node expansion based on conditions other than the * fanout size). */ @SuppressWarnings({"rawtypes","unchecked"}) public UnCompiledNode(Builder<T> owner, int depth) { this.owner = owner; arcs = (Arc<T>[]) new Arc[1]; arcs[0] = new Arc<>(); output = owner.NO_OUTPUT; this.depth = depth; }