/** * Get the remaining path after the given path to get this path * * @param from * @return the remaining path having remove the matching elements from the given path */ public SelectorPath from(SelectorPath from) { int i = 0; List<SelectorPart> remaining = new ArrayList<>(path); while (!remaining.isEmpty() && from.getDepth() > i && from.path.get(i).equals(remaining.get(0))) { i++; remaining.remove(0); } return new SelectorPath(remaining); }
/** * Get the remaining path after the given path to get this path * * @param from * @return the remaining path having remove the matching elements from the given path */ public SelectorPath from(SelectorPath from) { int i = 0; List<SelectorPart> remaining = new ArrayList<>(path); while (!remaining.isEmpty() && from.getDepth() > i && from.path.get(i).equals(remaining.get(0))) { i++; remaining.remove(0); } return new SelectorPath(remaining); }