Changeset 11651 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2017-03-03T01:31:34+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/OffsetBookmark.java
r10742 r11651 17 17 18 18 public class OffsetBookmark { 19 p ublicstatic final List<OffsetBookmark> allBookmarks = new ArrayList<>();19 private static final List<OffsetBookmark> allBookmarks = new ArrayList<>(); 20 20 21 21 public String projectionCode; … … 94 94 } 95 95 96 /** 97 * Returns all bookmarks. 98 * @return all bookmarks (unmodifiable collection) 99 * @since 11651 100 */ 101 public static List<OffsetBookmark> getBookmarks() { 102 return Collections.unmodifiableList(allBookmarks); 103 } 104 105 /** 106 * Returns the number of bookmarks. 107 * @return the number of bookmarks 108 * @since 11651 109 */ 110 public static int getBookmarksSize() { 111 return allBookmarks.size(); 112 } 113 114 /** 115 * Adds a bookmark. 116 * @param ob bookmark to add 117 * @return {@code true} 118 * @since 11651 119 */ 120 public static boolean addBookmark(OffsetBookmark ob) { 121 return allBookmarks.add(ob); 122 } 123 124 /** 125 * Removes a bookmark. 126 * @param ob bookmark to remove 127 * @return {@code true} if this list contained the specified element 128 * @since 11651 129 */ 130 public static boolean removeBookmark(OffsetBookmark ob) { 131 return allBookmarks.remove(ob); 132 } 133 134 /** 135 * Returns the bookmark at the given index. 136 * @param index bookmark index 137 * @return the bookmark at the given index 138 * @throws IndexOutOfBoundsException if the index is out of range 139 * (<tt>index < 0 || index >= size()</tt>) 140 * @since 11651 141 */ 142 public static OffsetBookmark getBookmarkByIndex(int index) { 143 return allBookmarks.get(index); 144 } 145 96 146 public static OffsetBookmark getBookmarkByName(ImageryLayer layer, String name) { 97 147 for (OffsetBookmark b : allBookmarks) {
Note:
See TracChangeset
for help on using the changeset viewer.