private void insertJobAt(Job j, int[] position) { if (position.length == 0) { this.contents = j; return; } int firstIndex = position[0]; if (firstIndex >= children.size()) { // Pad with blank NamedNode objects for (int i = children.size(); i <= firstIndex; i++) { children.add(null); } } NamedNode child = children.get(firstIndex); if (child == null) { child = new NamedNode(); children.set(firstIndex, child); } int[] newTarget = new int[position.length - 1]; for (int i = 1; i < position.length; i++) { newTarget[i - 1] = position[i]; } child.insertJobAt(j, newTarget); }
private void insertJobAt(Job j, int[] position) { if (position.length == 0) { this.contents = j; return; } int firstIndex = position[0]; if (firstIndex >= children.size()) { // Pad with blank NamedNode objects for (int i = children.size(); i <= firstIndex; i++) { children.add(null); } } NamedNode child = children.get(firstIndex); if (child == null) { child = new NamedNode(); children.set(firstIndex, child); } int[] newTarget = new int[position.length - 1]; for (int i = 1; i < position.length; i++) { newTarget[i - 1] = position[i]; } child.insertJobAt(j, newTarget); }
private void insertJobAt(Job j, int[] position) { if (position.length == 0) { this.contents = j; return; } int firstIndex = position[0]; if (firstIndex >= children.size()) { // Pad with blank NamedNode objects for (int i = children.size(); i <= firstIndex; i++) { children.add(null); } } NamedNode child = children.get(firstIndex); if (child == null) { child = new NamedNode(); children.set(firstIndex, child); } int[] newTarget = new int[position.length - 1]; for (int i = 1; i < position.length; i++) { newTarget[i - 1] = position[i]; } child.insertJobAt(j, newTarget); }
public void insertJob(Job j) { insertJobAt(j, j.getIndex()); }
public void insertJob(Job j) { //System.out.println("Store : "+j); insertJobAt(j, j.getIndex()); }
public void insertJob(Job j) { //System.out.println("Store : "+j); insertJobAt(j, j.getIndex()); }
protected synchronized NamedNode nodeAt(int[] position) { if (root == null) { return null; } NamedNode result = root; int index = 0; while (index < position.length && result != null) { result = result.childAt(position[index++]); } return result; }
protected synchronized NamedNode nodeAt(int[] position) { if (root == null) { return null; } NamedNode result = root; int index = 0; while (index < position.length && result != null) { result = result.childAt(position[index++]); } return result; }
protected synchronized NamedNode nodeAt(int[] position) { if (root == null) { return null; } NamedNode result = root; int index = 0; while (index < position.length && result != null) { result = result.childAt(position[index++]); } return result; }