@Override public boolean hasNext() { return i < getNameCount(); }
@Override public boolean hasNext() { return i < getNameCount(); }
@Override public Path getFileName() { if (getNameCount() == 0) { return null; } return getName(getNameCount() - 1); }
@Override public Path getFileName() { if (getNameCount() == 0) { return null; } return getName(getNameCount() - 1); }
@Override public Path next() { if (i < getNameCount()) { Path result = getName(i); i++; return result; } else { throw new NoSuchElementException(); } }
@Override public Path next() { if (i < getNameCount()) { Path result = getName(i); i++; return result; } else { throw new NoSuchElementException(); } }
@Override public Path getParent() { if (getNameCount() <= 0) { return null; } if (getNameCount() == 1) { return getRoot(); } return newPath(fs, substring(-1, getNameCount() - 2), host, isRealPath, isNormalized); }
@Override public Path getParent() { if (getNameCount() <= 0) { return null; } if (getNameCount() == 1) { return getRoot(); } return newPath(fs, substring(-1, getNameCount() - 2), host, isRealPath, isNormalized); }
@Override public boolean startsWith(final Path other) { checkNotNull("other", other); if (other.isAbsolute() != isAbsolute()) { return false; } if (!(other instanceof AbstractPath)) { return false; } final AbstractPath<?> that = (AbstractPath) other; int thisNameCount = getNameCount(); int thatNameCount = that.getNameCount(); if (thatNameCount > thisNameCount) { return false; } List<String> thisNames = getNamesIncludingRoot(); List<String> thatNames = that.getNamesIncludingRoot(); for (int i = 0; i < thatNames.size(); i++) { if (!thisNames.get(i).equals(thatNames.get(i))) { return false; } } return true; }
@Override public boolean startsWith(final Path other) { checkNotNull("other", other); if (other.isAbsolute() != isAbsolute()) { return false; } if (!(other instanceof AbstractPath)) { return false; } final AbstractPath<?> that = (AbstractPath) other; int thisNameCount = getNameCount(); int thatNameCount = that.getNameCount(); if (thatNameCount > thisNameCount) { return false; } List<String> thisNames = getNamesIncludingRoot(); List<String> thatNames = that.getNamesIncludingRoot(); for (int i = 0; i < thatNames.size(); i++) { if (!thisNames.get(i).equals(thatNames.get(i))) { return false; } } return true; }
int n = (getNameCount() > other.getNameCount()) ? other.getNameCount() : getNameCount(); int i = 0; while (i < n) { int numberOfDots = getNameCount() - i; if (numberOfDots == 0 && i < other.getNameCount()) { return other.subpath(i, other.getNameCount()); if (i < other.getNameCount()) { if (sb.length() > 0) { sb.append(getSeparator()); other.getNameCount())).toString(false); subpath = other.getSeparator() == getSeparator() ? subpath : subpath.replaceAll(other.quoteSeparator(), quoteSeparator()); sb.append(subpath);
int n = (getNameCount() > other.getNameCount()) ? other.getNameCount() : getNameCount(); int i = 0; while (i < n) { int numberOfDots = getNameCount() - i; if (numberOfDots == 0 && i < other.getNameCount()) { return other.subpath(i, other.getNameCount()); if (i < other.getNameCount()) { if (sb.length() > 0) { sb.append(getSeparator()); other.getNameCount())).toString(false); subpath = other.getSeparator() == getSeparator() ? subpath : subpath.replaceAll(other.quoteSeparator(), quoteSeparator()); sb.append(subpath);
int thisNameCount = getNameCount(); int thatNameCount = that.getNameCount();
int thisNameCount = getNameCount(); int thatNameCount = that.getNameCount();