@Override public String toString() { // CheckStyle:MagicNumber OFF final StringBuilder sb = new StringBuilder(name.length() + 4); // CheckStyle:MagicNumber ON toString(sb); return sb.toString(); }
/** * Converts a string representation of a node into a {@link Node} object. * * @param node String representation of node. * * @return Node corresponding to given string representation. * * @throws IllegalArgumentException for an invalid node name. */ static Node toNode(final String node) { final Matcher matcher = NODE_PATTERN.matcher(node); if (!matcher.matches()) { throw new IllegalArgumentException("Invalid node: " + node); } final String name = matcher.group(1); final String index = matcher.group(3); if (index != null) { return new Node(name, Integer.parseInt(index)); } return new Node(name); }
/** * Converts a string representation of a node into a {@link Node} object. * * @param node String representation of node. * * @return Node corresponding to given string representation. * * @throws IllegalArgumentException for an invalid node name. */ static Node toNode(final String node) { final Matcher matcher = NODE_PATTERN.matcher(node); if (!matcher.matches()) { throw new IllegalArgumentException("Invalid node: " + node); } final String name = matcher.group(1); final String index = matcher.group(3); if (index != null) { return new Node(name, Integer.parseInt(index)); } return new Node(name); }
/** * Converts a string representation of a node into a {@link Node} object. * * @param node String representation of node. * * @return Node corresponding to given string representation. * * @throws IllegalArgumentException for an invalid node name. */ static Node toNode(final String node) { final Matcher matcher = NODE_PATTERN.matcher(node); if (!matcher.matches()) { throw new IllegalArgumentException("Invalid node: " + node); } final String name = matcher.group(1); final String index = matcher.group(3); if (index != null) { return new Node(name, Integer.parseInt(index)); } return new Node(name); }
/** * Appends a node to the path with the given child index. * * @param name of the path element to add * @param index child index * * @return This instance with new node appended. */ public DERPath pushNode(final String name, final int index) { nodeStack.addLast(new Node(name, index)); return this; }
/** * Appends a node to the path with the given child index. * * @param name of the path element to add * @param index child index * * @return This instance with new node appended. */ public DERPath pushNode(final String name, final int index) { nodeStack.addLast(new Node(name, index)); return this; }
/** * Appends a node to the path with the given child index. * * @param name of the path element to add * @param index child index * * @return This instance with new node appended. */ public DERPath pushNode(final String name, final int index) { nodeStack.addLast(new Node(name, index)); return this; }
/** * Appends a node to the path. * * @param name of the path element to add * * @return This instance with new node appended. */ public DERPath pushNode(final String name) { nodeStack.addLast(new Node(name)); return this; }
@Override public String toString() { final StringBuilder sb = new StringBuilder(nodeStack.size() * 10); for (Node node : nodeStack) { sb.append(PATH_SEPARATOR); node.toString(sb); } return sb.toString(); }
/** * Removes the last node in the path. * * @return last node in the path or null if no more nodes remain. */ public String popNode() { if (nodeStack.isEmpty()) { return null; } return nodeStack.removeLast().toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(nodeStack.size() * 10); for (Node node : nodeStack) { sb.append(PATH_SEPARATOR); node.toString(sb); } return sb.toString(); }
/** * Examines the last node in the path without removing it. * * @return last node in the path or null if no nodes remain */ public String peekNode() { return nodeStack.peek().toString(); }
/** * Removes the last node in the path. * * @return last node in the path or null if no more nodes remain. */ public String popNode() { if (nodeStack.isEmpty()) { return null; } return nodeStack.removeLast().toString(); }
@Override public String toString() { // CheckStyle:MagicNumber OFF final StringBuilder sb = new StringBuilder(name.length() + 4); // CheckStyle:MagicNumber ON toString(sb); return sb.toString(); }
/** * Appends a node to the path. * * @param name of the path element to add * * @return This instance with new node appended. */ public DERPath pushNode(final String name) { nodeStack.addLast(new Node(name)); return this; }
@Override public String toString() { // CheckStyle:MagicNumber OFF final StringBuilder sb = new StringBuilder(name.length() + 4); // CheckStyle:MagicNumber ON toString(sb); return sb.toString(); }
@Override public String toString() { final StringBuilder sb = new StringBuilder(nodeStack.size() * 10); for (Node node : nodeStack) { sb.append(PATH_SEPARATOR); node.toString(sb); } return sb.toString(); }
/** * Examines the last node in the path without removing it. * * @return last node in the path or null if no nodes remain */ public String peekNode() { return nodeStack.peek().toString(); }
/** * Removes the last node in the path. * * @return last node in the path or null if no more nodes remain. */ public String popNode() { if (nodeStack.isEmpty()) { return null; } return nodeStack.removeLast().toString(); }
/** * Appends a node to the path. * * @param name of the path element to add * * @return This instance with new node appended. */ public DERPath pushNode(final String name) { nodeStack.addLast(new Node(name)); return this; }