/** * Gets the line geometry with the given line number. * * @param lineNumber the line number. * @return the line geometry. */ public LineGeometry getLineByNumber(final int lineNumber) { for (LineGeometry lineGeometry : _lineGeometries) { if (lineGeometry.getNumber() == lineNumber) { return lineGeometry; } } throw new IllegalArgumentException("Invalid line #: " + lineNumber); }
/** * Gets the line geometry with the given line name. * * @param lineName the line name. * @return the line geometry. */ public LineGeometry getLineByName(final String lineName) { for (LineGeometry lineGeometry : _lineGeometries) { if (lineGeometry.getDisplayName().equals(lineName)) { return lineGeometry; } } throw new IllegalArgumentException("Invalid line name: " + lineName); }