📄 landmarkstore.java
字号:
* stores * @throws java.lang.NullPointerException * if the parameter is null (the default landmark store can't be * deleted) * * @throws java.lang.SecurityException * if the appliction does not have permissions to delete a * landmark store */ public static void deleteLandmarkStore(String storeName) throws IOException, LandmarkException { throw new LandmarkException("Not supported."); } /** * Lists the names of all the available landmark stores. * * The default landmark store is obtained from getInstance by passing null * as the parameter. The null name for the default landmark store is not * included in the Vector returned by this method. If there are no named * landmark stores, other than the default landmark store, this method * returns null. * * Returns: * * @return an array of landmark store names * @throws java.lang.SecurityException * if the application does not have the permission to access * landmark stores * @throws java.io.IOException * if an I/O error occurred when trying to access the landmark * stores */ public static String[] listLandmarkStores() throws IOException { String[] names = new String[stores.length]; for (int i=0;i<stores.length;i++) { names[i] = (String) stores[i][0]; } return names; } /** * Gets the Landmarks from the storage where the category and/or name * matches the given parameters. * * @param category * the category of the landmark. null implies a wildcard that * matches all categories * @param name * the name of the desired landmark. null implies a wildcard that * matches all the names within * @return an Enumeration containing all the matching Landmarks or null if * no Landmark matched the given parameters * @throws IOException * if an I/O error happened when accessing the landmark store */ public Enumeration getLandmarks(String category, String name) throws IOException { return null; } /** * Lists all landmarks stored in the store. * * @return a java.util.Enumeration object containing Landmark objects * representing all the landmarks stored in this LandmarkStore or * null if there are no landmarks in the store * @throws IOException * if an I/O error happened when accessing the landmark store */ public Enumeration getLandmarks() throws IOException { return null; } /** * Lists all the landmarks that are within an area defined by bounding * minimum and maximum latitude and longitude and belong to the defined * category, if specified. The bounds are considered to belong to the area. * * If minLongitude <= maxLongitude, this area covers the longitude range * [minLongitude, maxLongitude]. If minLongitude > maxLongitude, this area * covers the longitude range [-180.0, maxLongitude] and [minLongitude, * 180.0). * * For latitude, the area covers the latitude range [minLatitude, * maxLatitude]. * * @param category * the category of the landmark. null implies a wildcard that * matches all categories * @param minLatitude * minimum latitude of the area. Must be within the range [-90.0, * 90.0] * @param maxLatitude * maximum latitude of the area. Must be within the range * [minLatitude, 90.0] * @param minLongitude * minimum longitude of the area. Must be within the range * [-180.0, 180.0) * @param maxLongitude * maximum longitude of the area. Must be within the range * [-180.0, 180.0) * @return an Enumeration containing all the matching Landmarks or null if * no Landmark matched the given parameters * @throws IOException * if an I/O error happened when accessing the landmark store * @throws java.lang.IllegalArgumentException * if the minLongitude or maxLongitude is out of the range * [-180.0, 180.0), or minLatitude or maxLatitude is out of the * range [-90.0,90.0], or if minLatitude > maxLatitude */ public Enumeration getLandmarks(String category, double minLatitude, double maxLatitude, double minLongitude, double maxLongitude) throws IOException { return null; } /** * Removes the named landmark from the specified category. * * The Landmark instance passed in as the parameter must be an instance that * belongs to this LandmarkStore. * * If the Landmark is not found in this LandmarkStore in the specified * category or if the parameter is a Landmark instance that does not belong * to this LandmarkStore, then the request is silently ignored and the * method call returns with no error. The request is also silently ignored * if the specified category does not exist in this LandmarkStore. * * The landmark is only removed from the specified category but the landmark * information is retained in the store. If the landmark no longer belongs * to any category, it can still be obtained from the store by passing null * as the category to getLandmarks. * * @param lm * the landmark to be removed * @param category * the category from which it will be removed. * @throws IOException * if an I/O error happened when accessing the landmark store * @throws java.lang.SecurityException * if the application is not allowed to delete the landmark * @throws java.lang.NullPointerException * if either parameter is null */ public void removeLandmarkFromCategory(Landmark lm, String category) throws IOException { } /** * Updates the information about a landmark. This method only updates the * information about a landmark and does not modify the categories the * landmark belongs to. * * The Landmark instance passed in as the parameter must be an instance that * belongs to this LandmarkStore. * * This method can't be used to add a new landmark to the store. * * @param lm * the landmark to be updated * @throws java.lang.SecurityException * if the application is not allowed to update the landmark * @throws LandmarkException * if the landmark instance passed as the parameter does not * belong to this LandmarkStore or does not exist in the store * any more * @throws java.io.IOException * if an I/O error happened when accessing the landmark store * @throws java.lang.NullPointerException * if the parameter is null */ public void updateLandmark(Landmark lm) throws IOException, LandmarkException { } /** * Deletes a landmark from this LandmarkStore. This method removes the * specified landmark from all categories and deletes the information from * this LandmarkStore. * * The Landmark instance passed in as the parameter must be an instance that * belongs to this LandmarkStore. * * If the Landmark is not found in this LandmarkStore, then the request is * silently ignored and the method call returns with no error. * * @param lm * the landmark to be deleted * @throws java.lang.SecurityException * if the application is not allowed to delete the landmark * @throws LandmarkException * if the landmark instance passed as the parameter does not * belong to this LandmarkStore * @throws java.io.IOException * if an I/O error happened when accessing the landmark store * @throws java.lang.NullPointerException * if the parameter is null */ public void deleteLandmark(Landmark lm) throws IOException, LandmarkException { } /** * Returns the category names that are defined in this LandmarkStore. The * language and locale used for these names depends on the implementation * and end user settings. The names shall be such that they can be displayed * to the end user and have a meaning to the end user * * @return an java.util.Enumeration containing Strings representing the * category names. If there are no categories defined in this * LandmarkStore, an Enumeration with no entries is returned. */ public Enumeration getCategories() { return null; } public static LandmarkStore getInstance (String storeName) { for (int i=0;i<stores.length;i++) { String name = (String) stores[i][0]; if (name.equals(storeName)) { try { if (stores[i][2] == null) stores[i][2] =(((Class)stores[i][1]).newInstance()); return (LandmarkStore) stores[i][2]; } catch (InstantiationException e) { throw new SecurityException(e.toString()); } catch (IllegalAccessException e) { throw new SecurityException(e.toString()); } } } return null; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -