public void removeChildren(String... fourcc) { for (Iterator<Box> it = boxes.iterator(); it.hasNext();) { Box box = it.next(); String fcc = box.getFourcc(); for (String cand : fourcc) { if (cand.equals(fcc)) { it.remove(); break; } } } } }
public void removeChildren(String... fourcc) { for (Iterator<Box> it = boxes.iterator(); it.hasNext();) { Box box = it.next(); String fcc = box.getFourcc(); for (String cand : fourcc) { if (cand.equals(fcc)) { it.remove(); break; } } } } }
private void dropChildBox(List<Box> children, String fourcc2) { ListIterator<Box> listIterator = children.listIterator(); while (listIterator.hasNext()) { Box next = listIterator.next(); if (fourcc2.equals(next.getFourcc())) { listIterator.remove(); } } }
public void removeChildren(String... arguments) { for (Iterator<Box> it = boxes.iterator(); it.hasNext();) { Box box = it.next(); String fcc = box.getFourcc(); for (int i = 0; i < arguments.length; i++) { String cand = arguments[i]; if (cand.equals(fcc)) { it.remove(); break; } } } }
private static Box findDeep(NodeBox root, String atom) { for (Box b : root.getBoxes()) { if (atom.equalsIgnoreCase(b.getFourcc())) { return b; } else if (b instanceof NodeBox) { Box res = findDeep((NodeBox) b, atom); if (res != null) return res; } } return null; }
public void replaceBox(Box box) { removeChildren(box.getFourcc()); add(box); }
public void replace(Box box) { removeChildren(box.getFourcc()); add(box); }
public void replace(Box box) { removeChildren(box.getFourcc()); add(box); }
public static <T extends Box> T[] findAllPath(Box box, Class<T> class1, String[] path) { List<Box> result = new LinkedList<Box>(); List<String> tlist = new LinkedList<String>(); for (int i = 0; i < path.length; i++) { String type = path[i]; tlist.add(type); } findBox(box, tlist, result); for (ListIterator<Box> it = result.listIterator(); it.hasNext();) { Box next = it.next(); if (next == null) { it.remove(); } else if (!Platform.isAssignableFrom(class1, next.getClass())) { // Trying to reinterpret one box as the other try { it.set(Box.asBox(class1, next)); } catch (Exception e) { Logger.warn("Failed to reinterpret box: " + next.getFourcc() + " as: " + class1.getName() + "." + e.getMessage()); it.remove(); } } } return result.toArray((T[]) Array.newInstance(class1, 0)); }