@Test public void concat() { Path a = new Path("this.a.b.c"); Path b = new Path("this.x.y.z"); assertEquals("Path.concat(a,b)", "this.a.b.c.x.y.z", Path.concat(a, b).toString()); }
public static Path concat(Path... paths) { if (paths == null) { throw new IllegalArgumentException("paths==null"); } if (paths.length == 0) { return null; } Path first = paths[0]; boolean prefixWithTHIS = first == null || first.pathStr.startsWith(THIS_PATH_ELEMENT); List<String> elements = new LinkedList<String>(); for (Path p : paths) { if (p != null) { elements.addAll(p.getElements()); } } String[] elemArr = elements.toArray(new String[elements.size()]); String pathStr = toPathString(elemArr, prefixWithTHIS); return new Path(elemArr, pathStr); }
Path implements Iterable<String>, Serializable { public static Path concat(Path... paths) { if (paths == null) { throw new IllegalArgumentException("paths==null"); } if (paths.length == 0) { return null; } Path first = paths[0]; boolean prefixWithTHIS = first == null || first.pathStr.startsWith(THIS_PATH_ELEMENT); List<String> elements = new LinkedList<String>(); for (Path p : paths) { if (p != null) { elements.addAll(p.getElements()); } } String[] elemArr = elements.toArray(new String[elements.size()]); String pathStr = toPathString(elemArr, prefixWithTHIS); return new Path(elemArr, pathStr); } }
Path implements Iterable<String>, Serializable { public static Path concat(Path... paths) { if (paths == null) { throw new IllegalArgumentException("paths==null"); } if (paths.length == 0) { return null; } Path first = paths[0]; boolean prefixWithTHIS = first == null || first.pathStr.startsWith(THIS_PATH_ELEMENT); List<String> elements = new LinkedList<String>(); for (Path p : paths) { if (p != null) { elements.addAll(p.getElements()); } } String[] elemArr = elements.toArray(new String[elements.size()]); String pathStr = toPathString(elemArr, prefixWithTHIS); return new Path(elemArr, pathStr); } Path();  Path(String pathStr); private  Path(String[] elements, String pathStr); }
Path implements Iterable<String>, Serializable { public static Path concat(Path... paths) { if (paths == null) { throw new IllegalArgumentException("paths==null"); } if (paths.length == 0) { return null; } Path first = paths[0]; boolean prefixWithTHIS = first == null || first.pathStr.startsWith(THIS_PATH_ELEMENT); List<String> elements = new LinkedList<String>(); for (Path p : paths) { if (p != null) { elements.addAll(p.getElements()); } } String[] elemArr = elements.toArray(new String[elements.size()]); String pathStr = toPathString(elemArr, prefixWithTHIS); return new Path(elemArr, pathStr); } Path();  Path(String pathStr); private  Path(String[] elements, String pathStr); Path getParent(); Path getSubPath(int fromPosition); Path getSubPath(int fromPosition, int length); int length(); Iterator<String> iterator(); Collection<String> getElements(); String getElement(int index); String getLastElement(); String toString(); String getPathString(); int hashCode(); boolean equals(Object obj); static Path parse(String pathStr); static String getPathString(Path path); static Path concat(Path... paths); static String toPathString(List<String> listOfStrings); static String toPathString(String[] strings); }
Path implements Iterable<String>, Serializable { public static Path concat(Path... paths) { if (paths == null) { throw new IllegalArgumentException("paths==null"); } if (paths.length == 0) { return null; } Path first = paths[0]; boolean prefixWithTHIS = first == null || first.pathStr.startsWith(THIS_PATH_ELEMENT); List<String> elements = new LinkedList<String>(); for (Path p : paths) { if (p != null) { elements.addAll(p.getElements()); } } String[] elemArr = elements.toArray(new String[elements.size()]); String pathStr = toPathString(elemArr, prefixWithTHIS); return new Path(elemArr, pathStr); } Path();  Path(String pathStr); private  Path(String[] elements, String pathStr); Path getParent(); Path getSubPath(int fromPosition); Path getSubPath(int fromPosition, int length); int length(); Iterator<String> iterator(); Collection<String> getElements(); String getElement(int index); String getLastElement(); String toString(); String getPathString(); int hashCode(); boolean equals(Object obj); static Path parse(String pathStr); static String getPathString(Path path); static Path concat(Path... paths); static String toPathString(List<String> listOfStrings); static String toPathString(String[] strings); static final String THIS_PATH_ELEMENT; static final String PATH_SEPARATOR; static final char PATH_SEPARATOR_CHAR; }