public static boolean containsTileSource(final String aName) { for (final ITileSource tileSource : mTileSources) { if (tileSource.name().equals(aName)) { return true; } } return false; }
/** * Get the tile source at the specified position. * * @param aOrdinal * @return the tile source * @throws IllegalArgumentException if tile source not found */ public static ITileSource getTileSource(final int aOrdinal) throws IllegalArgumentException { for (final ITileSource tileSource : mTileSources) { if (tileSource.ordinal() == aOrdinal) { return tileSource; } } throw new IllegalArgumentException("No tile source at position: " + aOrdinal); }
/** * Get the tile source with the specified name. * * @param aName the tile source name * @return the tile source * @throws IllegalArgumentException if tile source not found */ public static ITileSource getTileSource(final String aName) throws IllegalArgumentException { for (final ITileSource tileSource : mTileSources) { if (tileSource.name().equals(aName)) { return tileSource; } } throw new IllegalArgumentException("No such tile source: " + aName); }