class Path implements Iterable<ChildKey>, Comparable<Path> {

  public boolean contains(Path other) {
    if (this.size() > other.size()) {
      return false;
    }

    int i = this.start;
    int j = other.start;
    while (i < this.end) {
      if (!this.pieces[i].equals(other.pieces[j])) {
        return false;
      }
      i++;
      j++;
    }

    return true;
  }

  public  Path(ChildKey... segments);
  public  Path(List<String> segments);
  public  Path(String pathString);
  private  Path(ChildKey[] pieces, int start, int end);

}