/** * Gets stopwatch from the specified parent stopwatch with the specified task title. * * @param parent the specified parent * @param taskTitle the specified task title * @return stopwatch, returns {@code null} if not found */ private static Stopwatch get(final Stopwatch parent, final String taskTitle) { if (taskTitle.equals(parent.getTaskTitle())) { return parent; } for (final Stopwatch leaf : parent.getLeaves()) { final Stopwatch ret = get(leaf, taskTitle); if (null != ret) { return ret; } } return null; }
final Stopwatch stopwatch = get(root, taskTitle);
/** * Gets stopwatch from the specified parent stopwatch with the specified task title. * * @param parent the specified parent * @param taskTitle the specified task title * @return stopwatch, returns {@code null} if not found */ private static Stopwatch get(final Stopwatch parent, final String taskTitle) { if (taskTitle.equals(parent.getTaskTitle())) { return parent; } for (final Stopwatch leaf : parent.getLeaves()) { final Stopwatch ret = get(leaf, taskTitle); if (null != ret) { return ret; } } return null; }
final Stopwatch stopwatch = get(root, taskTitle);