id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
59,200
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.list
@Override public List<ApiType> list() { lock.lock(); try { List<ApiType> itemList = new ArrayList<>(this.items.size()); for (Map.Entry<String, ApiType> entry : this.items.entrySet()) { itemList.add(entry.getValue()); } return itemList; } finally { lock.unlock(); }...
java
@Override public List<ApiType> list() { lock.lock(); try { List<ApiType> itemList = new ArrayList<>(this.items.size()); for (Map.Entry<String, ApiType> entry : this.items.entrySet()) { itemList.add(entry.getValue()); } return itemList; } finally { lock.unlock(); }...
[ "@", "Override", "public", "List", "<", "ApiType", ">", "list", "(", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "List", "<", "ApiType", ">", "itemList", "=", "new", "ArrayList", "<>", "(", "this", ".", "items", ".", "size", "(", ")...
List all objects in the cache. @return the list
[ "List", "all", "objects", "in", "the", "cache", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L192-L204
59,201
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.index
@Override public List<ApiType> index(String indexName, Object obj) { lock.lock(); try { if (!this.indexers.containsKey(indexName)) { throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName)); } Function<ApiType, List<String>> indexFunc = this.indexers.ge...
java
@Override public List<ApiType> index(String indexName, Object obj) { lock.lock(); try { if (!this.indexers.containsKey(indexName)) { throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName)); } Function<ApiType, List<String>> indexFunc = this.indexers.ge...
[ "@", "Override", "public", "List", "<", "ApiType", ">", "index", "(", "String", "indexName", ",", "Object", "obj", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "!", "this", ".", "indexers", ".", "containsKey", "(", "indexName"...
Get objects . @param indexName the index name @param obj the obj @return the list
[ "Get", "objects", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L229-L259
59,202
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.indexKeys
@Override public List<String> indexKeys(String indexName, String indexKey) { lock.lock(); try { if (!this.indexers.containsKey(indexName)) { throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName)); } Map<String, Set<String>> index = this.indices.get(in...
java
@Override public List<String> indexKeys(String indexName, String indexKey) { lock.lock(); try { if (!this.indexers.containsKey(indexName)) { throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName)); } Map<String, Set<String>> index = this.indices.get(in...
[ "@", "Override", "public", "List", "<", "String", ">", "indexKeys", "(", "String", "indexName", ",", "String", "indexKey", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "!", "this", ".", "indexers", ".", "containsKey", "(", "in...
Index keys list. @param indexName the index name @param indexKey the index key @return the list
[ "Index", "keys", "list", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L268-L285
59,203
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.byIndex
@Override public List<ApiType> byIndex(String indexName, String indexKey) { lock.lock(); try { if (!this.indexers.containsKey(indexName)) { throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName)); } Map<String, Set<String>> index = this.indices.get(ind...
java
@Override public List<ApiType> byIndex(String indexName, String indexKey) { lock.lock(); try { if (!this.indexers.containsKey(indexName)) { throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName)); } Map<String, Set<String>> index = this.indices.get(ind...
[ "@", "Override", "public", "List", "<", "ApiType", ">", "byIndex", "(", "String", "indexName", ",", "String", "indexKey", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "!", "this", ".", "indexers", ".", "containsKey", "(", "ind...
By index list. @param indexName the index name @param indexKey the index key @return the list
[ "By", "index", "list", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L294-L314
59,204
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.updateIndices
public void updateIndices(ApiType oldObj, ApiType newObj, String key) { // if we got an old object, we need to remove it before we can add // it again. if (oldObj != null) { deleteFromIndices(oldObj, key); } for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : indexers.entrySet...
java
public void updateIndices(ApiType oldObj, ApiType newObj, String key) { // if we got an old object, we need to remove it before we can add // it again. if (oldObj != null) { deleteFromIndices(oldObj, key); } for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : indexers.entrySet...
[ "public", "void", "updateIndices", "(", "ApiType", "oldObj", ",", "ApiType", "newObj", ",", "String", "key", ")", "{", "// if we got an old object, we need to remove it before we can add", "// it again.", "if", "(", "oldObj", "!=", "null", ")", "{", "deleteFromIndices",...
updateIndices modifies the objects location in the managed indexes, if this is an update, you must provide an oldObj. <p>Note: updateIndices must be called from a function that already has a lock on the cache. @param oldObj the old obj @param newObj the new obj @param key the key
[ "updateIndices", "modifies", "the", "objects", "location", "in", "the", "managed", "indexes", "if", "this", "is", "an", "update", "you", "must", "provide", "an", "oldObj", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L326-L347
59,205
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.deleteFromIndices
private void deleteFromIndices(ApiType oldObj, String key) { for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : this.indexers.entrySet()) { Function<ApiType, List<String>> indexFunc = indexEntry.getValue(); List<String> indexValues = indexFunc.apply(oldObj); if (io.kubernetes.cli...
java
private void deleteFromIndices(ApiType oldObj, String key) { for (Map.Entry<String, Function<ApiType, List<String>>> indexEntry : this.indexers.entrySet()) { Function<ApiType, List<String>> indexFunc = indexEntry.getValue(); List<String> indexValues = indexFunc.apply(oldObj); if (io.kubernetes.cli...
[ "private", "void", "deleteFromIndices", "(", "ApiType", "oldObj", ",", "String", "key", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "Function", "<", "ApiType", ",", "List", "<", "String", ">", ">", ">", "indexEntry", ":", "this", "."...
deleteFromIndices removes the object from each of the managed indexes. <p>Note: It is intended to be called from a function that already has a lock on the cache. @param oldObj the old obj @param key the key
[ "deleteFromIndices", "removes", "the", "object", "from", "each", "of", "the", "managed", "indexes", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L357-L376
59,206
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.deletionHandlingMetaNamespaceKeyFunc
public static <ApiType> String deletionHandlingMetaNamespaceKeyFunc(ApiType object) { if (object instanceof DeltaFIFO.DeletedFinalStateUnknown) { DeltaFIFO.DeletedFinalStateUnknown deleteObj = (DeltaFIFO.DeletedFinalStateUnknown) object; return deleteObj.getKey(); } return metaNamespaceKeyFunc(o...
java
public static <ApiType> String deletionHandlingMetaNamespaceKeyFunc(ApiType object) { if (object instanceof DeltaFIFO.DeletedFinalStateUnknown) { DeltaFIFO.DeletedFinalStateUnknown deleteObj = (DeltaFIFO.DeletedFinalStateUnknown) object; return deleteObj.getKey(); } return metaNamespaceKeyFunc(o...
[ "public", "static", "<", "ApiType", ">", "String", "deletionHandlingMetaNamespaceKeyFunc", "(", "ApiType", "object", ")", "{", "if", "(", "object", "instanceof", "DeltaFIFO", ".", "DeletedFinalStateUnknown", ")", "{", "DeltaFIFO", ".", "DeletedFinalStateUnknown", "del...
deletionHandlingMetaNamespaceKeyFunc checks for DeletedFinalStateUnknown objects before calling metaNamespaceKeyFunc. @param object specific object @return the key
[ "deletionHandlingMetaNamespaceKeyFunc", "checks", "for", "DeletedFinalStateUnknown", "objects", "before", "calling", "metaNamespaceKeyFunc", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L385-L391
59,207
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/cache/Cache.java
Cache.metaNamespaceIndexFunc
public static List<String> metaNamespaceIndexFunc(Object obj) { try { V1ObjectMeta metadata = Reflect.objectMetadata(obj); if (metadata == null) { return Collections.emptyList(); } return Collections.singletonList(metadata.getNamespace()); } catch (ObjectMetaReflectException e) {...
java
public static List<String> metaNamespaceIndexFunc(Object obj) { try { V1ObjectMeta metadata = Reflect.objectMetadata(obj); if (metadata == null) { return Collections.emptyList(); } return Collections.singletonList(metadata.getNamespace()); } catch (ObjectMetaReflectException e) {...
[ "public", "static", "List", "<", "String", ">", "metaNamespaceIndexFunc", "(", "Object", "obj", ")", "{", "try", "{", "V1ObjectMeta", "metadata", "=", "Reflect", ".", "objectMetadata", "(", "obj", ")", ";", "if", "(", "metadata", "==", "null", ")", "{", ...
metaNamespaceIndexFunc is a default index function that indexes based on an object's namespace. @param obj specific object @return the indexed value
[ "metaNamespaceIndexFunc", "is", "a", "default", "index", "function", "that", "indexes", "based", "on", "an", "object", "s", "namespace", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/cache/Cache.java#L430-L441
59,208
kubernetes-client/java
util/src/main/java/io/kubernetes/client/ProtoClient.java
ProtoClient.list
public <T extends Message> ObjectOrStatus<T> list(T.Builder builder, String path) throws ApiException, IOException { return get(builder, path); }
java
public <T extends Message> ObjectOrStatus<T> list(T.Builder builder, String path) throws ApiException, IOException { return get(builder, path); }
[ "public", "<", "T", "extends", "Message", ">", "ObjectOrStatus", "<", "T", ">", "list", "(", "T", ".", "Builder", "builder", ",", "String", "path", ")", "throws", "ApiException", ",", "IOException", "{", "return", "get", "(", "builder", ",", "path", ")",...
List is fluent, semantic sugar method on top of get, which is intended to convey that the object is a List of objects rather than a single object @param builder The appropriate Builder for the object received from the request. @param path The URL path to call (e.g. /api/v1/namespaces/default/pods/pod-name) @return An ...
[ "List", "is", "fluent", "semantic", "sugar", "method", "on", "top", "of", "get", "which", "is", "intended", "to", "convey", "that", "the", "object", "is", "a", "List", "of", "objects", "rather", "than", "a", "single", "object" ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/ProtoClient.java#L115-L118
59,209
kubernetes-client/java
util/src/main/java/io/kubernetes/client/ProtoClient.java
ProtoClient.create
public <T extends Message> ObjectOrStatus<T> create( T obj, String path, String apiVersion, String kind) throws ApiException, IOException { return request(obj.newBuilderForType(), path, "POST", obj, apiVersion, kind); }
java
public <T extends Message> ObjectOrStatus<T> create( T obj, String path, String apiVersion, String kind) throws ApiException, IOException { return request(obj.newBuilderForType(), path, "POST", obj, apiVersion, kind); }
[ "public", "<", "T", "extends", "Message", ">", "ObjectOrStatus", "<", "T", ">", "create", "(", "T", "obj", ",", "String", "path", ",", "String", "apiVersion", ",", "String", "kind", ")", "throws", "ApiException", ",", "IOException", "{", "return", "request...
Create a Kubernetes API object using protocol buffer encoding. Performs a POST @param obj The object to create @param path The URL path to call @param apiVersion The api version to use @param kind The kind of the object @return An ObjectOrStatus which contains the Object requested, or a Status about the request.
[ "Create", "a", "Kubernetes", "API", "object", "using", "protocol", "buffer", "encoding", ".", "Performs", "a", "POST" ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/ProtoClient.java#L129-L132
59,210
kubernetes-client/java
util/src/main/java/io/kubernetes/client/ProtoClient.java
ProtoClient.request
public <T extends Message> ObjectOrStatus<T> request( T.Builder builder, String path, String method, T body, String apiVersion, String kind) throws ApiException, IOException { HashMap<String, String> headers = new HashMap<>(); headers.put("Content-Type", MEDIA_TYPE); headers.put("Accept", MEDIA_...
java
public <T extends Message> ObjectOrStatus<T> request( T.Builder builder, String path, String method, T body, String apiVersion, String kind) throws ApiException, IOException { HashMap<String, String> headers = new HashMap<>(); headers.put("Content-Type", MEDIA_TYPE); headers.put("Accept", MEDIA_...
[ "public", "<", "T", "extends", "Message", ">", "ObjectOrStatus", "<", "T", ">", "request", "(", "T", ".", "Builder", "builder", ",", "String", "path", ",", "String", "method", ",", "T", "body", ",", "String", "apiVersion", ",", "String", "kind", ")", "...
Generic protocol buffer based HTTP request. Not intended for general consumption, but public for advance use cases. @param builder The appropriate Builder for the object received from the request. @param method The HTTP method (e.g. GET) for this request. @param path The URL path to call (e.g. /api/v1/namespaces/defau...
[ "Generic", "protocol", "buffer", "based", "HTTP", "request", ".", "Not", "intended", "for", "general", "consumption", "but", "public", "for", "advance", "use", "cases", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/ProtoClient.java#L234-L291
59,211
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/WebSockets.java
WebSockets.stream
public static void stream(String path, String method, ApiClient client, SocketListener listener) throws ApiException, IOException { stream(path, method, new ArrayList<Pair>(), client, listener); }
java
public static void stream(String path, String method, ApiClient client, SocketListener listener) throws ApiException, IOException { stream(path, method, new ArrayList<Pair>(), client, listener); }
[ "public", "static", "void", "stream", "(", "String", "path", ",", "String", "method", ",", "ApiClient", "client", ",", "SocketListener", "listener", ")", "throws", "ApiException", ",", "IOException", "{", "stream", "(", "path", ",", "method", ",", "new", "Ar...
Create a new WebSocket stream @param path The HTTP Path to request from the API @param method The HTTP method to use for the call @param client The ApiClient for communicating with the API @param listener The socket listener to handle socket events
[ "Create", "a", "new", "WebSocket", "stream" ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/WebSockets.java#L77-L80
59,212
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java
WebSocketStreamHandler.getInputStream
public synchronized InputStream getInputStream(int stream) { if (state == State.CLOSED) throw new IllegalStateException(); if (!input.containsKey(stream)) { try { PipedInputStream pipeIn = new PipedInputStream(); PipedOutputStream pipeOut = new PipedOutputStream(pipeIn); pi...
java
public synchronized InputStream getInputStream(int stream) { if (state == State.CLOSED) throw new IllegalStateException(); if (!input.containsKey(stream)) { try { PipedInputStream pipeIn = new PipedInputStream(); PipedOutputStream pipeOut = new PipedOutputStream(pipeIn); pi...
[ "public", "synchronized", "InputStream", "getInputStream", "(", "int", "stream", ")", "{", "if", "(", "state", "==", "State", ".", "CLOSED", ")", "throw", "new", "IllegalStateException", "(", ")", ";", "if", "(", "!", "input", ".", "containsKey", "(", "str...
Get a specific input stream using its identifier. Caller is responsible for closing these streams. @param stream The stream to return @return The specified stream.
[ "Get", "a", "specific", "input", "stream", "using", "its", "identifier", ".", "Caller", "is", "responsible", "for", "closing", "these", "streams", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java#L121-L137
59,213
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java
WebSocketStreamHandler.getOutputStream
public synchronized OutputStream getOutputStream(int stream) { if (!output.containsKey(stream)) { output.put(stream, new WebSocketOutputStream(stream)); } return output.get(stream); }
java
public synchronized OutputStream getOutputStream(int stream) { if (!output.containsKey(stream)) { output.put(stream, new WebSocketOutputStream(stream)); } return output.get(stream); }
[ "public", "synchronized", "OutputStream", "getOutputStream", "(", "int", "stream", ")", "{", "if", "(", "!", "output", ".", "containsKey", "(", "stream", ")", ")", "{", "output", ".", "put", "(", "stream", ",", "new", "WebSocketOutputStream", "(", "stream", ...
Gets a specific output stream using it's identified @param stream The stream to return @return The specified stream.
[ "Gets", "a", "specific", "output", "stream", "using", "it", "s", "identified" ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java#L145-L150
59,214
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java
WebSocketStreamHandler.getSocketInputOutputStream
private synchronized OutputStream getSocketInputOutputStream(int stream) { if (!pipedOutput.containsKey(stream)) { try { PipedInputStream pipeIn = new PipedInputStream(); PipedOutputStream pipeOut = new PipedOutputStream(pipeIn); pipedOutput.put(stream, pipeOut); input.pu...
java
private synchronized OutputStream getSocketInputOutputStream(int stream) { if (!pipedOutput.containsKey(stream)) { try { PipedInputStream pipeIn = new PipedInputStream(); PipedOutputStream pipeOut = new PipedOutputStream(pipeIn); pipedOutput.put(stream, pipeOut); input.pu...
[ "private", "synchronized", "OutputStream", "getSocketInputOutputStream", "(", "int", "stream", ")", "{", "if", "(", "!", "pipedOutput", ".", "containsKey", "(", "stream", ")", ")", "{", "try", "{", "PipedInputStream", "pipeIn", "=", "new", "PipedInputStream", "(...
Get the pipe to write data to a specific InputStream. This is called when new data is read from the web socket, to send the data on to the right stream. @param stream The stream to return @return The specified stream.
[ "Get", "the", "pipe", "to", "write", "data", "to", "a", "specific", "InputStream", ".", "This", "is", "called", "when", "new", "data", "is", "read", "from", "the", "web", "socket", "to", "send", "the", "data", "on", "to", "the", "right", "stream", "." ...
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/WebSocketStreamHandler.java#L159-L173
59,215
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformer.java
DefaultSharedIndexInformer.addEventHandlerWithResyncPeriod
@Override public void addEventHandlerWithResyncPeriod( ResourceEventHandler<ApiType> handler, long resyncPeriodMillis) { if (stopped) { log.info( "DefaultSharedIndexInformer#Handler was not added to shared informer because it has stopped already"); return; } if (resyncPeriodMi...
java
@Override public void addEventHandlerWithResyncPeriod( ResourceEventHandler<ApiType> handler, long resyncPeriodMillis) { if (stopped) { log.info( "DefaultSharedIndexInformer#Handler was not added to shared informer because it has stopped already"); return; } if (resyncPeriodMi...
[ "@", "Override", "public", "void", "addEventHandlerWithResyncPeriod", "(", "ResourceEventHandler", "<", "ApiType", ">", "handler", ",", "long", "resyncPeriodMillis", ")", "{", "if", "(", "stopped", ")", "{", "log", ".", "info", "(", "\"DefaultSharedIndexInformer#Han...
add event callback with a resync period
[ "add", "event", "callback", "with", "a", "resync", "period" ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformer.java#L70-L117
59,216
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformer.java
DefaultSharedIndexInformer.handleDeltas
private void handleDeltas(Deque<MutablePair<DeltaFIFO.DeltaType, Object>> deltas) { if (Collections.isEmptyCollection(deltas)) { return; } // from oldest to newest for (MutablePair<DeltaFIFO.DeltaType, Object> delta : deltas) { DeltaFIFO.DeltaType deltaType = delta.getLeft(); switch (...
java
private void handleDeltas(Deque<MutablePair<DeltaFIFO.DeltaType, Object>> deltas) { if (Collections.isEmptyCollection(deltas)) { return; } // from oldest to newest for (MutablePair<DeltaFIFO.DeltaType, Object> delta : deltas) { DeltaFIFO.DeltaType deltaType = delta.getLeft(); switch (...
[ "private", "void", "handleDeltas", "(", "Deque", "<", "MutablePair", "<", "DeltaFIFO", ".", "DeltaType", ",", "Object", ">", ">", "deltas", ")", "{", "if", "(", "Collections", ".", "isEmptyCollection", "(", "deltas", ")", ")", "{", "return", ";", "}", "/...
handleDeltas handles deltas and call processor distribute. @param deltas deltas
[ "handleDeltas", "handles", "deltas", "and", "call", "processor", "distribute", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformer.java#L167-L198
59,217
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/Yaml.java
Yaml.loadAs
public static <T> T loadAs(String content, Class<T> clazz) { return getSnakeYaml().loadAs(new StringReader(content), clazz); }
java
public static <T> T loadAs(String content, Class<T> clazz) { return getSnakeYaml().loadAs(new StringReader(content), clazz); }
[ "public", "static", "<", "T", ">", "T", "loadAs", "(", "String", "content", ",", "Class", "<", "T", ">", "clazz", ")", "{", "return", "getSnakeYaml", "(", ")", ".", "loadAs", "(", "new", "StringReader", "(", "content", ")", ",", "clazz", ")", ";", ...
Load an API object from a YAML string representation. Returns a concrete typed object using the type specified. @param content The YAML content @param clazz The class of object to return. @return An instantiation of the object. @throws IOException If an error occurs while reading the YAML.
[ "Load", "an", "API", "object", "from", "a", "YAML", "string", "representation", ".", "Returns", "a", "concrete", "typed", "object", "using", "the", "type", "specified", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/Yaml.java#L196-L198
59,218
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/Yaml.java
Yaml.loadAs
public static <T> T loadAs(File f, Class<T> clazz) throws IOException { return getSnakeYaml().loadAs(new FileReader(f), clazz); }
java
public static <T> T loadAs(File f, Class<T> clazz) throws IOException { return getSnakeYaml().loadAs(new FileReader(f), clazz); }
[ "public", "static", "<", "T", ">", "T", "loadAs", "(", "File", "f", ",", "Class", "<", "T", ">", "clazz", ")", "throws", "IOException", "{", "return", "getSnakeYaml", "(", ")", ".", "loadAs", "(", "new", "FileReader", "(", "f", ")", ",", "clazz", "...
Load an API object from a YAML file. Returns a concrete typed object using the type specified. @param f The YAML file @param clazz The class of object to return. @return An instantiation of the object. @throws IOException If an error occurs while reading the YAML.
[ "Load", "an", "API", "object", "from", "a", "YAML", "file", ".", "Returns", "a", "concrete", "typed", "object", "using", "the", "type", "specified", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/Yaml.java#L208-L210
59,219
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/Yaml.java
Yaml.loadAs
public static <T> T loadAs(Reader reader, Class<T> clazz) { return getSnakeYaml().loadAs(reader, clazz); }
java
public static <T> T loadAs(Reader reader, Class<T> clazz) { return getSnakeYaml().loadAs(reader, clazz); }
[ "public", "static", "<", "T", ">", "T", "loadAs", "(", "Reader", "reader", ",", "Class", "<", "T", ">", "clazz", ")", "{", "return", "getSnakeYaml", "(", ")", ".", "loadAs", "(", "reader", ",", "clazz", ")", ";", "}" ]
Load an API object from a YAML stream. Returns a concrete typed object using the type specified. @param reader The YAML stream @param clazz The class of object to return. @return An instantiation of the object. @throws IOException If an error occurs while reading the YAML.
[ "Load", "an", "API", "object", "from", "a", "YAML", "stream", ".", "Returns", "a", "concrete", "typed", "object", "using", "the", "type", "specified", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/Yaml.java#L221-L223
59,220
kubernetes-client/java
util/src/main/java/io/kubernetes/client/util/Yaml.java
Yaml.dumpAll
public static void dumpAll(Iterator<? extends Object> data, Writer output) { getSnakeYaml().dumpAll(data, output); }
java
public static void dumpAll(Iterator<? extends Object> data, Writer output) { getSnakeYaml().dumpAll(data, output); }
[ "public", "static", "void", "dumpAll", "(", "Iterator", "<", "?", "extends", "Object", ">", "data", ",", "Writer", "output", ")", "{", "getSnakeYaml", "(", ")", ".", "dumpAll", "(", "data", ",", "output", ")", ";", "}" ]
Takes an Iterator of YAML API objects and writes a YAML String representing all of them. @param data The list of YAML API objects. @param output The writer to output the YAML String to.
[ "Takes", "an", "Iterator", "of", "YAML", "API", "objects", "and", "writes", "a", "YAML", "String", "representing", "all", "of", "them", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/util/Yaml.java#L316-L318
59,221
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java
SharedInformerFactory.sharedIndexInformerFor
public synchronized <ApiType, ApiListType> SharedIndexInformer<ApiType> sharedIndexInformerFor( Function<CallGeneratorParams, Call> callGenerator, Class<ApiType> apiTypeClass, Class<ApiListType> apiListTypeClass) { return sharedIndexInformerFor(callGenerator, apiTypeClass, apiListTypeClass, 0); ...
java
public synchronized <ApiType, ApiListType> SharedIndexInformer<ApiType> sharedIndexInformerFor( Function<CallGeneratorParams, Call> callGenerator, Class<ApiType> apiTypeClass, Class<ApiListType> apiListTypeClass) { return sharedIndexInformerFor(callGenerator, apiTypeClass, apiListTypeClass, 0); ...
[ "public", "synchronized", "<", "ApiType", ",", "ApiListType", ">", "SharedIndexInformer", "<", "ApiType", ">", "sharedIndexInformerFor", "(", "Function", "<", "CallGeneratorParams", ",", "Call", ">", "callGenerator", ",", "Class", "<", "ApiType", ">", "apiTypeClass"...
Shared index informer for shared index informer. @param <ApiType> the type parameter @param <ApiListType> the type parameter @param callGenerator the call generator @param apiTypeClass the api type class @param apiListTypeClass the api list type class @return the shared index informer
[ "Shared", "index", "informer", "for", "shared", "index", "informer", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java#L53-L58
59,222
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java
SharedInformerFactory.startAllRegisteredInformers
public synchronized void startAllRegisteredInformers() { if (Collections.isEmptyMap(informers)) { return; } informers.forEach( (informerType, informer) -> { if (!startedInformers.containsKey(informerType)) { startedInformers.put(informerType, informerExecutor.submit(infor...
java
public synchronized void startAllRegisteredInformers() { if (Collections.isEmptyMap(informers)) { return; } informers.forEach( (informerType, informer) -> { if (!startedInformers.containsKey(informerType)) { startedInformers.put(informerType, informerExecutor.submit(infor...
[ "public", "synchronized", "void", "startAllRegisteredInformers", "(", ")", "{", "if", "(", "Collections", ".", "isEmptyMap", "(", "informers", ")", ")", "{", "return", ";", "}", "informers", ".", "forEach", "(", "(", "informerType", ",", "informer", ")", "->...
Start all registered informers.
[ "Start", "all", "registered", "informers", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java#L110-L120
59,223
kubernetes-client/java
util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java
SharedInformerFactory.stopAllRegisteredInformers
public synchronized void stopAllRegisteredInformers() { if (Collections.isEmptyMap(informers)) { return; } informers.forEach( (informerType, informer) -> { if (startedInformers.containsKey(informerType)) { startedInformers.remove(informerType); informer.stop()...
java
public synchronized void stopAllRegisteredInformers() { if (Collections.isEmptyMap(informers)) { return; } informers.forEach( (informerType, informer) -> { if (startedInformers.containsKey(informerType)) { startedInformers.remove(informerType); informer.stop()...
[ "public", "synchronized", "void", "stopAllRegisteredInformers", "(", ")", "{", "if", "(", "Collections", ".", "isEmptyMap", "(", "informers", ")", ")", "{", "return", ";", "}", "informers", ".", "forEach", "(", "(", "informerType", ",", "informer", ")", "->"...
Stop all registered informers.
[ "Stop", "all", "registered", "informers", "." ]
7413e98bd904f09d1ad00fb60e8c6ff787f3f560
https://github.com/kubernetes-client/java/blob/7413e98bd904f09d1ad00fb60e8c6ff787f3f560/util/src/main/java/io/kubernetes/client/informer/SharedInformerFactory.java#L123-L135
59,224
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java
SwipeRecyclerView.setSwipeItemMenuEnabled
public void setSwipeItemMenuEnabled(int position, boolean enabled) { if (enabled) { if (mDisableSwipeItemMenuList.contains(position)) { mDisableSwipeItemMenuList.remove(Integer.valueOf(position)); } } else { if (!mDisableSwipeItemMenuList.contains(posi...
java
public void setSwipeItemMenuEnabled(int position, boolean enabled) { if (enabled) { if (mDisableSwipeItemMenuList.contains(position)) { mDisableSwipeItemMenuList.remove(Integer.valueOf(position)); } } else { if (!mDisableSwipeItemMenuList.contains(posi...
[ "public", "void", "setSwipeItemMenuEnabled", "(", "int", "position", ",", "boolean", "enabled", ")", "{", "if", "(", "enabled", ")", "{", "if", "(", "mDisableSwipeItemMenuList", ".", "contains", "(", "position", ")", ")", "{", "mDisableSwipeItemMenuList", ".", ...
Set the item menu to enable status. @param position the position of the item. @param enabled true means available, otherwise not available; default is true.
[ "Set", "the", "item", "menu", "to", "enable", "status", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java#L157-L167
59,225
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java
SwipeRecyclerView.addHeaderView
public void addHeaderView(View view) { mHeaderViewList.add(view); if (mAdapterWrapper != null) { mAdapterWrapper.addHeaderViewAndNotify(view); } }
java
public void addHeaderView(View view) { mHeaderViewList.add(view); if (mAdapterWrapper != null) { mAdapterWrapper.addHeaderViewAndNotify(view); } }
[ "public", "void", "addHeaderView", "(", "View", "view", ")", "{", "mHeaderViewList", ".", "add", "(", "view", ")", ";", "if", "(", "mAdapterWrapper", "!=", "null", ")", "{", "mAdapterWrapper", ".", "addHeaderViewAndNotify", "(", "view", ")", ";", "}", "}" ...
Add view at the headers.
[ "Add", "view", "at", "the", "headers", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java#L441-L446
59,226
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java
SwipeRecyclerView.removeHeaderView
public void removeHeaderView(View view) { mHeaderViewList.remove(view); if (mAdapterWrapper != null) { mAdapterWrapper.removeHeaderViewAndNotify(view); } }
java
public void removeHeaderView(View view) { mHeaderViewList.remove(view); if (mAdapterWrapper != null) { mAdapterWrapper.removeHeaderViewAndNotify(view); } }
[ "public", "void", "removeHeaderView", "(", "View", "view", ")", "{", "mHeaderViewList", ".", "remove", "(", "view", ")", ";", "if", "(", "mAdapterWrapper", "!=", "null", ")", "{", "mAdapterWrapper", ".", "removeHeaderViewAndNotify", "(", "view", ")", ";", "}...
Remove view from header.
[ "Remove", "view", "from", "header", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java#L451-L456
59,227
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java
SwipeRecyclerView.addFooterView
public void addFooterView(View view) { mFooterViewList.add(view); if (mAdapterWrapper != null) { mAdapterWrapper.addFooterViewAndNotify(view); } }
java
public void addFooterView(View view) { mFooterViewList.add(view); if (mAdapterWrapper != null) { mAdapterWrapper.addFooterViewAndNotify(view); } }
[ "public", "void", "addFooterView", "(", "View", "view", ")", "{", "mFooterViewList", ".", "add", "(", "view", ")", ";", "if", "(", "mAdapterWrapper", "!=", "null", ")", "{", "mAdapterWrapper", ".", "addFooterViewAndNotify", "(", "view", ")", ";", "}", "}" ...
Add view at the footer.
[ "Add", "view", "at", "the", "footer", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/SwipeRecyclerView.java#L461-L466
59,228
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java
ExpandableAdapter.expandParent
public final void expandParent(int parentPosition) { if (!isExpanded(parentPosition)) { mExpandItemArray.append(parentPosition, true); int position = positionFromParentPosition(parentPosition); int childCount = childItemCount(parentPosition); notifyItemRangeInser...
java
public final void expandParent(int parentPosition) { if (!isExpanded(parentPosition)) { mExpandItemArray.append(parentPosition, true); int position = positionFromParentPosition(parentPosition); int childCount = childItemCount(parentPosition); notifyItemRangeInser...
[ "public", "final", "void", "expandParent", "(", "int", "parentPosition", ")", "{", "if", "(", "!", "isExpanded", "(", "parentPosition", ")", ")", "{", "mExpandItemArray", ".", "append", "(", "parentPosition", ",", "true", ")", ";", "int", "position", "=", ...
Expand parent. @param parentPosition position of parent item.
[ "Expand", "parent", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java#L56-L64
59,229
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java
ExpandableAdapter.collapseParent
public final void collapseParent(int parentPosition) { if (isExpanded(parentPosition)) { mExpandItemArray.append(parentPosition, false); int position = positionFromParentPosition(parentPosition); int childCount = childItemCount(parentPosition); notifyItemRangeRem...
java
public final void collapseParent(int parentPosition) { if (isExpanded(parentPosition)) { mExpandItemArray.append(parentPosition, false); int position = positionFromParentPosition(parentPosition); int childCount = childItemCount(parentPosition); notifyItemRangeRem...
[ "public", "final", "void", "collapseParent", "(", "int", "parentPosition", ")", "{", "if", "(", "isExpanded", "(", "parentPosition", ")", ")", "{", "mExpandItemArray", ".", "append", "(", "parentPosition", ",", "false", ")", ";", "int", "position", "=", "pos...
Collapse parent. @param parentPosition position of parent item.
[ "Collapse", "parent", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java#L71-L79
59,230
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java
ExpandableAdapter.isParentItem
public final boolean isParentItem(int adapterPosition) { int itemCount = 0; int parentCount = parentItemCount(); for (int i = 0; i < parentCount; i++) { if (itemCount == adapterPosition) { return true; } itemCount += 1; if (isExp...
java
public final boolean isParentItem(int adapterPosition) { int itemCount = 0; int parentCount = parentItemCount(); for (int i = 0; i < parentCount; i++) { if (itemCount == adapterPosition) { return true; } itemCount += 1; if (isExp...
[ "public", "final", "boolean", "isParentItem", "(", "int", "adapterPosition", ")", "{", "int", "itemCount", "=", "0", ";", "int", "parentCount", "=", "parentItemCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parentCount", ";", ...
Item is a parent item. @param adapterPosition adapter position. @return true, otherwise is false.
[ "Item", "is", "a", "parent", "item", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java#L260-L279
59,231
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java
ExpandableAdapter.parentItemPosition
public final int parentItemPosition(int adapterPosition) { int itemCount = 0; for (int i = 0; i < parentItemCount(); i++) { itemCount += 1; if (isExpanded(i)) { int childCount = childItemCount(i); itemCount += childCount; } ...
java
public final int parentItemPosition(int adapterPosition) { int itemCount = 0; for (int i = 0; i < parentItemCount(); i++) { itemCount += 1; if (isExpanded(i)) { int childCount = childItemCount(i); itemCount += childCount; } ...
[ "public", "final", "int", "parentItemPosition", "(", "int", "adapterPosition", ")", "{", "int", "itemCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parentItemCount", "(", ")", ";", "i", "++", ")", "{", "itemCount", "+=", "1"...
Get the position of the parent item from the adapter position. @param adapterPosition adapter position of item.
[ "Get", "the", "position", "of", "the", "parent", "item", "from", "the", "adapter", "position", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java#L286-L301
59,232
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java
ExpandableAdapter.childItemPosition
public final int childItemPosition(int childAdapterPosition) { int itemCount = 0; int parentCount = parentItemCount(); for (int i = 0; i < parentCount; i++) { itemCount += 1; if (isExpanded(i)) { int childCount = childItemCount(i); itemCo...
java
public final int childItemPosition(int childAdapterPosition) { int itemCount = 0; int parentCount = parentItemCount(); for (int i = 0; i < parentCount; i++) { itemCount += 1; if (isExpanded(i)) { int childCount = childItemCount(i); itemCo...
[ "public", "final", "int", "childItemPosition", "(", "int", "childAdapterPosition", ")", "{", "int", "itemCount", "=", "0", ";", "int", "parentCount", "=", "parentItemCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parentCount", "...
Get the position of the child item from the adapter position. @param childAdapterPosition adapter position of child item.
[ "Get", "the", "position", "of", "the", "child", "item", "from", "the", "adapter", "position", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/ExpandableAdapter.java#L308-L328
59,233
yanzhenjie/SwipeRecyclerView
support/src/main/java/com/yanzhenjie/recyclerview/widget/Drawer.java
Drawer.drawLeft
public void drawLeft(View view, Canvas c) { int left = view.getLeft() - mWidth; int top = view.getTop() - mHeight; int right = left + mWidth; int bottom = view.getBottom() + mHeight; mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); }
java
public void drawLeft(View view, Canvas c) { int left = view.getLeft() - mWidth; int top = view.getTop() - mHeight; int right = left + mWidth; int bottom = view.getBottom() + mHeight; mDivider.setBounds(left, top, right, bottom); mDivider.draw(c); }
[ "public", "void", "drawLeft", "(", "View", "view", ",", "Canvas", "c", ")", "{", "int", "left", "=", "view", ".", "getLeft", "(", ")", "-", "mWidth", ";", "int", "top", "=", "view", ".", "getTop", "(", ")", "-", "mHeight", ";", "int", "right", "=...
Draw the divider on the left side of the Item.
[ "Draw", "the", "divider", "on", "the", "left", "side", "of", "the", "Item", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/support/src/main/java/com/yanzhenjie/recyclerview/widget/Drawer.java#L40-L47
59,234
yanzhenjie/SwipeRecyclerView
x/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuLayout.java
SwipeMenuLayout.getSwipeDuration
private int getSwipeDuration(MotionEvent ev, int velocity) { int sx = getScrollX(); int dx = (int)(ev.getX() - sx); final int width = mSwipeCurrentHorizontal.getMenuWidth(); final int halfWidth = width / 2; final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / width); ...
java
private int getSwipeDuration(MotionEvent ev, int velocity) { int sx = getScrollX(); int dx = (int)(ev.getX() - sx); final int width = mSwipeCurrentHorizontal.getMenuWidth(); final int halfWidth = width / 2; final float distanceRatio = Math.min(1f, 1.0f * Math.abs(dx) / width); ...
[ "private", "int", "getSwipeDuration", "(", "MotionEvent", "ev", ",", "int", "velocity", ")", "{", "int", "sx", "=", "getScrollX", "(", ")", ";", "int", "dx", "=", "(", "int", ")", "(", "ev", ".", "getX", "(", ")", "-", "sx", ")", ";", "final", "i...
compute finish duration. @param ev up event. @param velocity velocity x. @return finish duration.
[ "compute", "finish", "duration", "." ]
69aa14d05da09beaeb880240c62f7de6f4f1bb39
https://github.com/yanzhenjie/SwipeRecyclerView/blob/69aa14d05da09beaeb880240c62f7de6f4f1bb39/x/src/main/java/com/yanzhenjie/recyclerview/SwipeMenuLayout.java#L305-L321
59,235
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderArray.java
MapTileProviderArray.findNextAppropriateProvider
protected MapTileModuleProviderBase findNextAppropriateProvider(final MapTileRequestState aState) { MapTileModuleProviderBase provider; boolean providerDoesntExist = false, providerCantGetDataConnection = false, providerCantServiceZoomlevel = false; // The logic of the while statement is // "Keep looping until ...
java
protected MapTileModuleProviderBase findNextAppropriateProvider(final MapTileRequestState aState) { MapTileModuleProviderBase provider; boolean providerDoesntExist = false, providerCantGetDataConnection = false, providerCantServiceZoomlevel = false; // The logic of the while statement is // "Keep looping until ...
[ "protected", "MapTileModuleProviderBase", "findNextAppropriateProvider", "(", "final", "MapTileRequestState", "aState", ")", "{", "MapTileModuleProviderBase", "provider", ";", "boolean", "providerDoesntExist", "=", "false", ",", "providerCantGetDataConnection", "=", "false", ...
We want to not use a provider that doesn't exist anymore in the chain, and we want to not use a provider that requires a data connection when one is not available.
[ "We", "want", "to", "not", "use", "a", "provider", "that", "doesn", "t", "exist", "anymore", "in", "the", "chain", "and", "we", "want", "to", "not", "use", "a", "provider", "that", "requires", "a", "data", "connection", "when", "one", "is", "not", "ava...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderArray.java#L198-L219
59,236
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/AsyncTaskDemoFragment.java
AsyncTaskDemoFragment.reloadMarker
private void reloadMarker(BoundingBox latLonArea, double zoom) { Log.d(TAG,"reloadMarker " + latLonArea + ", zoom " + zoom); this.mCurrentBackgroundMarkerLoaderTask = new BackgroundMarkerLoaderTask(); this.mCurrentBackgroundMarkerLoaderTask.execute( latLonArea.getLatSouth(), latL...
java
private void reloadMarker(BoundingBox latLonArea, double zoom) { Log.d(TAG,"reloadMarker " + latLonArea + ", zoom " + zoom); this.mCurrentBackgroundMarkerLoaderTask = new BackgroundMarkerLoaderTask(); this.mCurrentBackgroundMarkerLoaderTask.execute( latLonArea.getLatSouth(), latL...
[ "private", "void", "reloadMarker", "(", "BoundingBox", "latLonArea", ",", "double", "zoom", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"reloadMarker \"", "+", "latLonArea", "+", "\", zoom \"", "+", "zoom", ")", ";", "this", ".", "mCurrentBackgroundMarkerLoa...
called by MapView if zoom or scroll has changed to reload marker for new visible region
[ "called", "by", "MapView", "if", "zoom", "or", "scroll", "has", "changed", "to", "reload", "marker", "for", "new", "visible", "region" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/AsyncTaskDemoFragment.java#L163-L169
59,237
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTilePreCache.java
MapTilePreCache.next
private long next() { while(true) { final long index; synchronized (mTileAreas) { if(!mTileIndices.hasNext()) { return -1; } index = mTileIndices.next(); } final Drawable drawable = mCache.getMapT...
java
private long next() { while(true) { final long index; synchronized (mTileAreas) { if(!mTileIndices.hasNext()) { return -1; } index = mTileIndices.next(); } final Drawable drawable = mCache.getMapT...
[ "private", "long", "next", "(", ")", "{", "while", "(", "true", ")", "{", "final", "long", "index", ";", "synchronized", "(", "mTileAreas", ")", "{", "if", "(", "!", "mTileIndices", ".", "hasNext", "(", ")", ")", "{", "return", "-", "1", ";", "}", ...
Get the next tile to search for @return -1 if not found
[ "Get", "the", "next", "tile", "to", "search", "for" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTilePreCache.java#L95-L109
59,238
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTilePreCache.java
MapTilePreCache.search
private void search(final long pMapTileIndex) { for (final MapTileModuleProviderBase provider : mProviders) { try { if (provider instanceof MapTileDownloader) { final ITileSource tileSource = ((MapTileDownloader) provider).getTileSource(); if (...
java
private void search(final long pMapTileIndex) { for (final MapTileModuleProviderBase provider : mProviders) { try { if (provider instanceof MapTileDownloader) { final ITileSource tileSource = ((MapTileDownloader) provider).getTileSource(); if (...
[ "private", "void", "search", "(", "final", "long", "pMapTileIndex", ")", "{", "for", "(", "final", "MapTileModuleProviderBase", "provider", ":", "mProviders", ")", "{", "try", "{", "if", "(", "provider", "instanceof", "MapTileDownloader", ")", "{", "final", "I...
Search for a tile bitmap into the list of providers and put it in the memory cache
[ "Search", "for", "a", "tile", "bitmap", "into", "the", "list", "of", "providers", "and", "put", "it", "in", "the", "memory", "cache" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTilePreCache.java#L114-L135
59,239
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/OfflinePickerSample.java
OfflinePickerSample.promptForFiles
private void promptForFiles() { DialogProperties properties = new DialogProperties(); properties.selection_mode = DialogConfigs.MULTI_MODE; properties.selection_type = DialogConfigs.FILE_SELECT; properties.root = new File(DialogConfigs.DEFAULT_DIR); properties.error_dir = new Fil...
java
private void promptForFiles() { DialogProperties properties = new DialogProperties(); properties.selection_mode = DialogConfigs.MULTI_MODE; properties.selection_type = DialogConfigs.FILE_SELECT; properties.root = new File(DialogConfigs.DEFAULT_DIR); properties.error_dir = new Fil...
[ "private", "void", "promptForFiles", "(", ")", "{", "DialogProperties", "properties", "=", "new", "DialogProperties", "(", ")", ";", "properties", ".", "selection_mode", "=", "DialogConfigs", ".", "MULTI_MODE", ";", "properties", ".", "selection_type", "=", "Dialo...
step 1, users selects files
[ "step", "1", "users", "selects", "files" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/OfflinePickerSample.java#L102-L131
59,240
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/OfflinePickerSample.java
OfflinePickerSample.promptForTileSource
private void promptForTileSource() { AlertDialog.Builder builderSingle = new AlertDialog.Builder(getContext()); builderSingle.setIcon(R.drawable.icon); builderSingle.setTitle("Select Offline Tile source:-"); final ArrayAdapter<ITileSource> arrayAdapter = new ArrayAdapter<ITileSource>(ge...
java
private void promptForTileSource() { AlertDialog.Builder builderSingle = new AlertDialog.Builder(getContext()); builderSingle.setIcon(R.drawable.icon); builderSingle.setTitle("Select Offline Tile source:-"); final ArrayAdapter<ITileSource> arrayAdapter = new ArrayAdapter<ITileSource>(ge...
[ "private", "void", "promptForTileSource", "(", ")", "{", "AlertDialog", ".", "Builder", "builderSingle", "=", "new", "AlertDialog", ".", "Builder", "(", "getContext", "(", ")", ")", ";", "builderSingle", ".", "setIcon", "(", "R", ".", "drawable", ".", "icon"...
step 3 ask for the tile source
[ "step", "3", "ask", "for", "the", "tile", "source" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/OfflinePickerSample.java#L261-L326
59,241
osmdroid/osmdroid
osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileSource.java
MapsForgeTileSource.renderTile
public synchronized Drawable renderTile(final long pMapTileIndex) { Tile tile = new Tile(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), (byte) MapTileIndex.getZoom(pMapTileIndex), 256); model.setFixedTileSize(256); //You could try something like this to load a custom theme...
java
public synchronized Drawable renderTile(final long pMapTileIndex) { Tile tile = new Tile(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), (byte) MapTileIndex.getZoom(pMapTileIndex), 256); model.setFixedTileSize(256); //You could try something like this to load a custom theme...
[ "public", "synchronized", "Drawable", "renderTile", "(", "final", "long", "pMapTileIndex", ")", "{", "Tile", "tile", "=", "new", "Tile", "(", "MapTileIndex", ".", "getX", "(", "pMapTileIndex", ")", ",", "MapTileIndex", ".", "getY", "(", "pMapTileIndex", ")", ...
The synchronized here is VERY important. If missing, the mapDatabase read gets corrupted by multiple threads reading the file at once.
[ "The", "synchronized", "here", "is", "VERY", "important", ".", "If", "missing", "the", "mapDatabase", "read", "gets", "corrupted", "by", "multiple", "threads", "reading", "the", "file", "at", "once", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileSource.java#L178-L207
59,242
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/GeoPoint.java
GeoPoint.destinationPoint
public GeoPoint destinationPoint(final double aDistanceInMeters, final double aBearingInDegrees) { // convert distance to angular distance final double dist = aDistanceInMeters / RADIUS_EARTH_METERS; // convert bearing to radians final double brng = DEG2RAD * aBearingInDegrees; // get current location in r...
java
public GeoPoint destinationPoint(final double aDistanceInMeters, final double aBearingInDegrees) { // convert distance to angular distance final double dist = aDistanceInMeters / RADIUS_EARTH_METERS; // convert bearing to radians final double brng = DEG2RAD * aBearingInDegrees; // get current location in r...
[ "public", "GeoPoint", "destinationPoint", "(", "final", "double", "aDistanceInMeters", ",", "final", "double", "aBearingInDegrees", ")", "{", "// convert distance to angular distance", "final", "double", "dist", "=", "aDistanceInMeters", "/", "RADIUS_EARTH_METERS", ";", "...
Calculate a point that is the specified distance and bearing away from this point. @see <a href="http://www.movable-type.co.uk/scripts/latlong.html">latlong.html</a> @see <a href="http://www.movable-type.co.uk/scripts/latlon.js">latlon.js</a>
[ "Calculate", "a", "point", "that", "is", "the", "specified", "distance", "and", "bearing", "away", "from", "this", "point", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/GeoPoint.java#L288-L310
59,243
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/Distance.java
Distance.getSquaredDistanceToPoint
public static double getSquaredDistanceToPoint( final double pFromX, final double pFromY, final double pToX, final double pToY) { final double dX = pFromX - pToX; final double dY = pFromY - pToY; return dX * dX + dY * dY; }
java
public static double getSquaredDistanceToPoint( final double pFromX, final double pFromY, final double pToX, final double pToY) { final double dX = pFromX - pToX; final double dY = pFromY - pToY; return dX * dX + dY * dY; }
[ "public", "static", "double", "getSquaredDistanceToPoint", "(", "final", "double", "pFromX", ",", "final", "double", "pFromY", ",", "final", "double", "pToX", ",", "final", "double", "pToY", ")", "{", "final", "double", "dX", "=", "pFromX", "-", "pToX", ";",...
Square of the distance between two points
[ "Square", "of", "the", "distance", "between", "two", "points" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/Distance.java#L16-L21
59,244
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/Distance.java
Distance.getSquaredDistanceToLine
public static double getSquaredDistanceToLine( final double pFromX, final double pFromY, final double pAX, final double pAY, final double pBX, final double pBY ) { return getSquaredDistanceToProjection(pFromX, pFromY, pAX, pAY, pBX, pBY, getProjectionFactorToLine(pFro...
java
public static double getSquaredDistanceToLine( final double pFromX, final double pFromY, final double pAX, final double pAY, final double pBX, final double pBY ) { return getSquaredDistanceToProjection(pFromX, pFromY, pAX, pAY, pBX, pBY, getProjectionFactorToLine(pFro...
[ "public", "static", "double", "getSquaredDistanceToLine", "(", "final", "double", "pFromX", ",", "final", "double", "pFromY", ",", "final", "double", "pAX", ",", "final", "double", "pAY", ",", "final", "double", "pBX", ",", "final", "double", "pBY", ")", "{"...
Square of the distance between a point and line AB
[ "Square", "of", "the", "distance", "between", "a", "point", "and", "line", "AB" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/Distance.java#L26-L32
59,245
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/Distance.java
Distance.getSquaredDistanceToSegment
public static double getSquaredDistanceToSegment( final double pFromX, final double pFromY, final double pAX, final double pAY, final double pBX, final double pBY ) { return getSquaredDistanceToProjection(pFromX, pFromY, pAX, pAY, pBX, pBY, getProjectionFactorToSegmen...
java
public static double getSquaredDistanceToSegment( final double pFromX, final double pFromY, final double pAX, final double pAY, final double pBX, final double pBY ) { return getSquaredDistanceToProjection(pFromX, pFromY, pAX, pAY, pBX, pBY, getProjectionFactorToSegmen...
[ "public", "static", "double", "getSquaredDistanceToSegment", "(", "final", "double", "pFromX", ",", "final", "double", "pFromY", ",", "final", "double", "pAX", ",", "final", "double", "pAY", ",", "final", "double", "pBX", ",", "final", "double", "pBY", ")", ...
Square of the distance between a point and segment AB
[ "Square", "of", "the", "distance", "between", "a", "point", "and", "segment", "AB" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/Distance.java#L37-L43
59,246
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/Distance.java
Distance.dotProduct
private static double dotProduct( final double pAX, final double pAY, final double pBX, final double pBY, final double pCX, final double pCY) { return (pBX - pAX) * (pCX - pAX) + (pBY - pAY) * (pCY - pAY); }
java
private static double dotProduct( final double pAX, final double pAY, final double pBX, final double pBY, final double pCX, final double pCY) { return (pBX - pAX) * (pCX - pAX) + (pBY - pAY) * (pCY - pAY); }
[ "private", "static", "double", "dotProduct", "(", "final", "double", "pAX", ",", "final", "double", "pAY", ",", "final", "double", "pBX", ",", "final", "double", "pBY", ",", "final", "double", "pCX", ",", "final", "double", "pCY", ")", "{", "return", "("...
Compute the dot product AB x AC
[ "Compute", "the", "dot", "product", "AB", "x", "AC" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/Distance.java#L98-L102
59,247
osmdroid/osmdroid
GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/Googlev2WrapperSample.java
Googlev2WrapperSample.debugProjection
private void debugProjection() { new Thread() { @Override public void run() { // let the map get redrawn and a new projection calculated try { sleep(1000); } catch (InterruptedException ignore) { } ...
java
private void debugProjection() { new Thread() { @Override public void run() { // let the map get redrawn and a new projection calculated try { sleep(1000); } catch (InterruptedException ignore) { } ...
[ "private", "void", "debugProjection", "(", ")", "{", "new", "Thread", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "// let the map get redrawn and a new projection calculated", "try", "{", "sleep", "(", "1000", ")", ";", "}", "catch"...
This is just used for debugging
[ "This", "is", "just", "used", "for", "debugging" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/Googlev2WrapperSample.java#L194-L216
59,248
osmdroid/osmdroid
OSMMapTilePackager/src/main/java/org/osmdroid/mtp/OSMMapTilePackager.java
OSMMapTilePackager.run
private static void run(final String pServerURL, final String pDestinationFile, final String pTempFolder, final int pThreadCount, final String pFileAppendix, final int pMinZoom, final int pMaxZoom, final double pNorth, final double pSouth, final double pEast, final double pWest) { new File(pTempFolder).mkdir...
java
private static void run(final String pServerURL, final String pDestinationFile, final String pTempFolder, final int pThreadCount, final String pFileAppendix, final int pMinZoom, final int pMaxZoom, final double pNorth, final double pSouth, final double pEast, final double pWest) { new File(pTempFolder).mkdir...
[ "private", "static", "void", "run", "(", "final", "String", "pServerURL", ",", "final", "String", "pDestinationFile", ",", "final", "String", "pTempFolder", ",", "final", "int", "pThreadCount", ",", "final", "String", "pFileAppendix", ",", "final", "int", "pMinZ...
this starts executing the download and packaging @param pServerURL @param pDestinationFile @param pTempFolder @param pThreadCount @param pFileAppendix @param pMinZoom @param pMaxZoom @param pNorth @param pSouth @param pEast @param pWest
[ "this", "starts", "executing", "the", "download", "and", "packaging" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OSMMapTilePackager/src/main/java/org/osmdroid/mtp/OSMMapTilePackager.java#L166-L177
59,249
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java
CompassOverlay.disableCompass
public void disableCompass() { mIsCompassEnabled = false; if (mOrientationProvider != null) { mOrientationProvider.stopOrientationProvider(); } // Reset values mAzimuth = Float.NaN; // Update the screen to see changes take effect if (mMapView != nul...
java
public void disableCompass() { mIsCompassEnabled = false; if (mOrientationProvider != null) { mOrientationProvider.stopOrientationProvider(); } // Reset values mAzimuth = Float.NaN; // Update the screen to see changes take effect if (mMapView != nul...
[ "public", "void", "disableCompass", "(", ")", "{", "mIsCompassEnabled", "=", "false", ";", "if", "(", "mOrientationProvider", "!=", "null", ")", "{", "mOrientationProvider", ".", "stopOrientationProvider", "(", ")", ";", "}", "// Reset values", "mAzimuth", "=", ...
Disable orientation updates. Note the behavior has changed since v6.0.0. This method no longer releases references to the orientation provider. Instead, that happens in the onDetached method.
[ "Disable", "orientation", "updates", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java#L357-L371
59,250
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java
CompassOverlay.createCompassRosePicture
private void createCompassRosePicture() { // Paint design of north triangle (it's common to paint north in red color) final Paint northPaint = new Paint(); northPaint.setColor(0xFFA00000); northPaint.setAntiAlias(true); northPaint.setStyle(Style.FILL); northPaint.setAlpha...
java
private void createCompassRosePicture() { // Paint design of north triangle (it's common to paint north in red color) final Paint northPaint = new Paint(); northPaint.setColor(0xFFA00000); northPaint.setAntiAlias(true); northPaint.setStyle(Style.FILL); northPaint.setAlpha...
[ "private", "void", "createCompassRosePicture", "(", ")", "{", "// Paint design of north triangle (it's common to paint north in red color)", "final", "Paint", "northPaint", "=", "new", "Paint", "(", ")", ";", "northPaint", ".", "setColor", "(", "0xFFA00000", ")", ";", "...
A conventional red and black compass needle.
[ "A", "conventional", "red", "and", "black", "compass", "needle", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java#L497-L548
59,251
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java
CompassOverlay.createPointerPicture
private void createPointerPicture() { final Paint arrowPaint = new Paint(); arrowPaint.setColor(Color.BLACK); arrowPaint.setAntiAlias(true); arrowPaint.setStyle(Style.FILL); arrowPaint.setAlpha(220); // Create a little white dot in the middle of the compass rose ...
java
private void createPointerPicture() { final Paint arrowPaint = new Paint(); arrowPaint.setColor(Color.BLACK); arrowPaint.setAntiAlias(true); arrowPaint.setStyle(Style.FILL); arrowPaint.setAlpha(220); // Create a little white dot in the middle of the compass rose ...
[ "private", "void", "createPointerPicture", "(", ")", "{", "final", "Paint", "arrowPaint", "=", "new", "Paint", "(", ")", ";", "arrowPaint", ".", "setColor", "(", "Color", ".", "BLACK", ")", ";", "arrowPaint", ".", "setAntiAlias", "(", "true", ")", ";", "...
A black pointer arrow.
[ "A", "black", "pointer", "arrow", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/CompassOverlay.java#L553-L588
59,252
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.wrap
static double wrap(double n, double min, double max) { return (n >= min && n < max) ? n : (mod(n - min, max - min) + min); }
java
static double wrap(double n, double min, double max) { return (n >= min && n < max) ? n : (mod(n - min, max - min) + min); }
[ "static", "double", "wrap", "(", "double", "n", ",", "double", "min", ",", "double", "max", ")", "{", "return", "(", "n", ">=", "min", "&&", "n", "<", "max", ")", "?", "n", ":", "(", "mod", "(", "n", "-", "min", ",", "max", "-", "min", ")", ...
Wraps the given value into the inclusive-exclusive interval between min and max. @param n The value to wrap. @param min The minimum. @param max The maximum.
[ "Wraps", "the", "given", "value", "into", "the", "inclusive", "-", "exclusive", "interval", "between", "min", "and", "max", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L58-L60
59,253
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.computeHeading
public static double computeHeading(IGeoPoint from, IGeoPoint to) { // http://williams.best.vwh.net/avform.htm#Crs double fromLat = toRadians(from.getLatitude()); double fromLng = toRadians(from.getLongitude()); double toLat = toRadians(to.getLatitude()); double toLng = toRadians...
java
public static double computeHeading(IGeoPoint from, IGeoPoint to) { // http://williams.best.vwh.net/avform.htm#Crs double fromLat = toRadians(from.getLatitude()); double fromLng = toRadians(from.getLongitude()); double toLat = toRadians(to.getLatitude()); double toLng = toRadians...
[ "public", "static", "double", "computeHeading", "(", "IGeoPoint", "from", ",", "IGeoPoint", "to", ")", "{", "// http://williams.best.vwh.net/avform.htm#Crs", "double", "fromLat", "=", "toRadians", "(", "from", ".", "getLatitude", "(", ")", ")", ";", "double", "fro...
Returns the heading from one LatLng to another LatLng. Headings are expressed in degrees clockwise from North within the range [-180,180). @return The heading in degrees clockwise from north.
[ "Returns", "the", "heading", "from", "one", "LatLng", "to", "another", "LatLng", ".", "Headings", "are", "expressed", "in", "degrees", "clockwise", "from", "North", "within", "the", "range", "[", "-", "180", "180", ")", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L136-L147
59,254
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.computeOffsetOrigin
public static IGeoPoint computeOffsetOrigin(IGeoPoint to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; // http://lists.maptools.org/pipermail/proj/2008-October/003939.html double n1 = cos(distance); double n2 = sin(distance) * cos(hea...
java
public static IGeoPoint computeOffsetOrigin(IGeoPoint to, double distance, double heading) { heading = toRadians(heading); distance /= EARTH_RADIUS; // http://lists.maptools.org/pipermail/proj/2008-October/003939.html double n1 = cos(distance); double n2 = sin(distance) * cos(hea...
[ "public", "static", "IGeoPoint", "computeOffsetOrigin", "(", "IGeoPoint", "to", ",", "double", "distance", ",", "double", "heading", ")", "{", "heading", "=", "toRadians", "(", "heading", ")", ";", "distance", "/=", "EARTH_RADIUS", ";", "// http://lists.maptools.o...
Returns the location of origin when provided with a IGeoPoint destination, meters travelled and original heading. Headings are expressed in degrees clockwise from North. This function returns null when no solution is available. @param to The destination IGeoPoint. @param distance The distance travelled, in meters...
[ "Returns", "the", "location", "of", "origin", "when", "provided", "with", "a", "IGeoPoint", "destination", "meters", "travelled", "and", "original", "heading", ".", "Headings", "are", "expressed", "in", "degrees", "clockwise", "from", "North", ".", "This", "func...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L182-L215
59,255
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.interpolate
public static IGeoPoint interpolate(IGeoPoint from, IGeoPoint to, double fraction) { // http://en.wikipedia.org/wiki/Slerp double fromLat = toRadians(from.getLatitude()); double fromLng = toRadians(from.getLongitude()); double toLat = toRadians(to.getLatitude()); double toLng = t...
java
public static IGeoPoint interpolate(IGeoPoint from, IGeoPoint to, double fraction) { // http://en.wikipedia.org/wiki/Slerp double fromLat = toRadians(from.getLatitude()); double fromLng = toRadians(from.getLongitude()); double toLat = toRadians(to.getLatitude()); double toLng = t...
[ "public", "static", "IGeoPoint", "interpolate", "(", "IGeoPoint", "from", ",", "IGeoPoint", "to", ",", "double", "fraction", ")", "{", "// http://en.wikipedia.org/wiki/Slerp", "double", "fromLat", "=", "toRadians", "(", "from", ".", "getLatitude", "(", ")", ")", ...
Returns the IGeoPoint which lies the given fraction of the way between the origin IGeoPoint and the destination IGeoPoint. @param from The IGeoPoint from which to start. @param to The IGeoPoint toward which to travel. @param fraction A fraction of the distance to travel. @return The interpolated IGeoPoint.
[ "Returns", "the", "IGeoPoint", "which", "lies", "the", "given", "fraction", "of", "the", "way", "between", "the", "origin", "IGeoPoint", "and", "the", "destination", "IGeoPoint", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L225-L252
59,256
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.distanceRadians
private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) { return arcHav(havDistance(lat1, lat2, lng1 - lng2)); }
java
private static double distanceRadians(double lat1, double lng1, double lat2, double lng2) { return arcHav(havDistance(lat1, lat2, lng1 - lng2)); }
[ "private", "static", "double", "distanceRadians", "(", "double", "lat1", ",", "double", "lng1", ",", "double", "lat2", ",", "double", "lng2", ")", "{", "return", "arcHav", "(", "havDistance", "(", "lat1", ",", "lat2", ",", "lng1", "-", "lng2", ")", ")", ...
Returns distance on the unit sphere; the arguments are in radians.
[ "Returns", "distance", "on", "the", "unit", "sphere", ";", "the", "arguments", "are", "in", "radians", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L257-L259
59,257
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.computeAngleBetween
static double computeAngleBetween(IGeoPoint from, IGeoPoint to) { return distanceRadians(toRadians(from.getLatitude()), toRadians(from.getLongitude()), toRadians(to.getLatitude()), toRadians(to.getLongitude())); }
java
static double computeAngleBetween(IGeoPoint from, IGeoPoint to) { return distanceRadians(toRadians(from.getLatitude()), toRadians(from.getLongitude()), toRadians(to.getLatitude()), toRadians(to.getLongitude())); }
[ "static", "double", "computeAngleBetween", "(", "IGeoPoint", "from", ",", "IGeoPoint", "to", ")", "{", "return", "distanceRadians", "(", "toRadians", "(", "from", ".", "getLatitude", "(", ")", ")", ",", "toRadians", "(", "from", ".", "getLongitude", "(", ")"...
Returns the angle between two IGeoPoints, in radians. This is the same as the distance on the unit sphere.
[ "Returns", "the", "angle", "between", "two", "IGeoPoints", "in", "radians", ".", "This", "is", "the", "same", "as", "the", "distance", "on", "the", "unit", "sphere", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L265-L268
59,258
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.computeLength
public static double computeLength(List<IGeoPoint> path) { if (path.size() < 2) { return 0; } double length = 0; IGeoPoint prev = path.get(0); double prevLat = toRadians(prev.getLatitude()); double prevLng = toRadians(prev.getLongitude()); for (IGeoPoi...
java
public static double computeLength(List<IGeoPoint> path) { if (path.size() < 2) { return 0; } double length = 0; IGeoPoint prev = path.get(0); double prevLat = toRadians(prev.getLatitude()); double prevLng = toRadians(prev.getLongitude()); for (IGeoPoi...
[ "public", "static", "double", "computeLength", "(", "List", "<", "IGeoPoint", ">", "path", ")", "{", "if", "(", "path", ".", "size", "(", ")", "<", "2", ")", "{", "return", "0", ";", "}", "double", "length", "=", "0", ";", "IGeoPoint", "prev", "=",...
Returns the length of the given path, in meters, on Earth.
[ "Returns", "the", "length", "of", "the", "given", "path", "in", "meters", "on", "Earth", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L280-L296
59,259
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java
SphericalUtil.computeSignedArea
static double computeSignedArea(List<IGeoPoint> path, double radius) { int size = path.size(); if (size < 3) { return 0; } double total = 0; IGeoPoint prev = path.get(size - 1); double prevTanLat = tan((PI / 2 - toRadians(prev.getLatitude())) / 2); double prevLng = toRadi...
java
static double computeSignedArea(List<IGeoPoint> path, double radius) { int size = path.size(); if (size < 3) { return 0; } double total = 0; IGeoPoint prev = path.get(size - 1); double prevTanLat = tan((PI / 2 - toRadians(prev.getLatitude())) / 2); double prevLng = toRadi...
[ "static", "double", "computeSignedArea", "(", "List", "<", "IGeoPoint", ">", "path", ",", "double", "radius", ")", "{", "int", "size", "=", "path", ".", "size", "(", ")", ";", "if", "(", "size", "<", "3", ")", "{", "return", "0", ";", "}", "double"...
Returns the signed area of a closed path on a sphere of given radius. The computed area uses the same units as the radius squared. Used by SphericalUtilTest.
[ "Returns", "the", "signed", "area", "of", "a", "closed", "path", "on", "a", "sphere", "of", "given", "radius", ".", "The", "computed", "area", "uses", "the", "same", "units", "as", "the", "radius", "squared", ".", "Used", "by", "SphericalUtilTest", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/SphericalUtil.java#L323-L340
59,260
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java
TilesOverlay.protectDisplayedTilesForCache
public void protectDisplayedTilesForCache(final Canvas pCanvas, final Projection pProjection) { if (!setViewPort(pCanvas, pProjection)) { return; } TileSystem.getTileFromMercator(mViewPort, TileSystem.getTileSize(mProjection.getZoomLevel()), mProtectedTiles); final int tileZoomLevel = TileSystem.getInputTile...
java
public void protectDisplayedTilesForCache(final Canvas pCanvas, final Projection pProjection) { if (!setViewPort(pCanvas, pProjection)) { return; } TileSystem.getTileFromMercator(mViewPort, TileSystem.getTileSize(mProjection.getZoomLevel()), mProtectedTiles); final int tileZoomLevel = TileSystem.getInputTile...
[ "public", "void", "protectDisplayedTilesForCache", "(", "final", "Canvas", "pCanvas", ",", "final", "Projection", "pProjection", ")", "{", "if", "(", "!", "setViewPort", "(", "pCanvas", ",", "pProjection", ")", ")", "{", "return", ";", "}", "TileSystem", ".", ...
Populates the tile provider's memory cache with the list of displayed tiles @since 6.0.0
[ "Populates", "the", "tile", "provider", "s", "memory", "cache", "with", "the", "list", "of", "displayed", "tiles" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java#L171-L179
59,261
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java
TilesOverlay.setViewPort
protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) { setProjection(pProjection); getProjection().getMercatorViewPort(mViewPort); return true; }
java
protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) { setProjection(pProjection); getProjection().getMercatorViewPort(mViewPort); return true; }
[ "protected", "boolean", "setViewPort", "(", "final", "Canvas", "pCanvas", ",", "final", "Projection", "pProjection", ")", "{", "setProjection", "(", "pProjection", ")", ";", "getProjection", "(", ")", ".", "getMercatorViewPort", "(", "mViewPort", ")", ";", "retu...
Get the area we are drawing to @since 6.0.0 @return true if the tiles are to be drawn
[ "Get", "the", "area", "we", "are", "drawing", "to" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/TilesOverlay.java#L186-L190
59,262
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/StreamUtils.java
StreamUtils.closeStream
public static void closeStream(final Closeable stream) { if (stream != null) { try { stream.close(); } catch (final IOException e) { //don't use android classes here, since this class is used outside of android e.printStackTrace(); } } }
java
public static void closeStream(final Closeable stream) { if (stream != null) { try { stream.close(); } catch (final IOException e) { //don't use android classes here, since this class is used outside of android e.printStackTrace(); } } }
[ "public", "static", "void", "closeStream", "(", "final", "Closeable", "stream", ")", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "final", "IOException", "e", ")", "{", "//don...
Closes the specified stream. @param stream The stream to close.
[ "Closes", "the", "specified", "stream", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/StreamUtils.java#L76-L85
59,263
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/SampleZoomToBounding.java
SampleZoomToBounding.addPoints
private void addPoints(final List<GeoPoint> pPoints, final double pBeginLat, final double pBeginLon, final double pEndLat, final double pEndLon) { final double increment = 10; // in degrees pPoints.add(new GeoPoint(pBeginLat, pBeginLon)); dou...
java
private void addPoints(final List<GeoPoint> pPoints, final double pBeginLat, final double pBeginLon, final double pEndLat, final double pEndLon) { final double increment = 10; // in degrees pPoints.add(new GeoPoint(pBeginLat, pBeginLon)); dou...
[ "private", "void", "addPoints", "(", "final", "List", "<", "GeoPoint", ">", "pPoints", ",", "final", "double", "pBeginLat", ",", "final", "double", "pBeginLon", ",", "final", "double", "pEndLat", ",", "final", "double", "pEndLon", ")", "{", "final", "double"...
Add a succession of GeoPoint's, separated by an increment, taken from the segment between two GeoPoint's @since 6.0.0
[ "Add", "a", "succession", "of", "GeoPoint", "s", "separated", "by", "an", "increment", "taken", "from", "the", "segment", "between", "two", "GeoPoint", "s" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/SampleZoomToBounding.java#L120-L157
59,264
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/LinearRing.java
LinearRing.buildLinePortion
void buildLinePortion(final Projection pProjection, final boolean pStorePoints){ final int size = mOriginalPoints.size(); if (size < 2) { // nothing to paint return; } computeProjected(pProjection); computeDistances(); final PointL offset = new PointL(); getBestOffset(pProjection, o...
java
void buildLinePortion(final Projection pProjection, final boolean pStorePoints){ final int size = mOriginalPoints.size(); if (size < 2) { // nothing to paint return; } computeProjected(pProjection); computeDistances(); final PointL offset = new PointL(); getBestOffset(pProjection, o...
[ "void", "buildLinePortion", "(", "final", "Projection", "pProjection", ",", "final", "boolean", "pStorePoints", ")", "{", "final", "int", "size", "=", "mOriginalPoints", ".", "size", "(", ")", ";", "if", "(", "size", "<", "2", ")", "{", "// nothing to paint"...
Dedicated to Polyline, as they can run much faster with drawLine than through a Path @since 6.0.0
[ "Dedicated", "to", "Polyline", "as", "they", "can", "run", "much", "faster", "with", "drawLine", "than", "through", "a", "Path" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/LinearRing.java#L207-L220
59,265
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/LinearRing.java
LinearRing.isCloseTo
boolean isCloseTo(final GeoPoint pPoint, final double tolerance, final Projection pProjection, final boolean pClosePath) { return getCloseTo(pPoint, tolerance, pProjection, pClosePath) != null; }
java
boolean isCloseTo(final GeoPoint pPoint, final double tolerance, final Projection pProjection, final boolean pClosePath) { return getCloseTo(pPoint, tolerance, pProjection, pClosePath) != null; }
[ "boolean", "isCloseTo", "(", "final", "GeoPoint", "pPoint", ",", "final", "double", "tolerance", ",", "final", "Projection", "pProjection", ",", "final", "boolean", "pClosePath", ")", "{", "return", "getCloseTo", "(", "pPoint", ",", "tolerance", ",", "pProjectio...
Detection is done in screen coordinates. @param tolerance in pixels @return true if the Polyline is close enough to the point.
[ "Detection", "is", "done", "in", "screen", "coordinates", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/LinearRing.java#L363-L366
59,266
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaDataResource.java
ImageryMetaDataResource.getInstanceFromJSON
static public ImageryMetaDataResource getInstanceFromJSON(final JSONObject a_jsonObject, final JSONObject parent) throws Exception { final ImageryMetaDataResource result = new ImageryMetaDataResource(); if(a_jsonObject==null) { throw new Exception("JSON to parse is null"); } result.copyright = parent.getSt...
java
static public ImageryMetaDataResource getInstanceFromJSON(final JSONObject a_jsonObject, final JSONObject parent) throws Exception { final ImageryMetaDataResource result = new ImageryMetaDataResource(); if(a_jsonObject==null) { throw new Exception("JSON to parse is null"); } result.copyright = parent.getSt...
[ "static", "public", "ImageryMetaDataResource", "getInstanceFromJSON", "(", "final", "JSONObject", "a_jsonObject", ",", "final", "JSONObject", "parent", ")", "throws", "Exception", "{", "final", "ImageryMetaDataResource", "result", "=", "new", "ImageryMetaDataResource", "(...
Parse a JSON string containing resource field of a ImageryMetaData response @param a_jsonObject the JSON content string @return ImageryMetaDataResource object containing parsed information @throws Exception
[ "Parse", "a", "JSON", "string", "containing", "resource", "field", "of", "a", "ImageryMetaData", "response" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaDataResource.java#L55-L95
59,267
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaDataResource.java
ImageryMetaDataResource.getSubDomain
public synchronized String getSubDomain() { if(m_imageUrlSubdomains==null || m_imageUrlSubdomains.length<=0) { return null; } final String result = m_imageUrlSubdomains[m_subdomainsCounter]; if(m_subdomainsCounter<m_imageUrlSubdomains.length-1) { m_subdomainsCounter++; } else { m_subdomainsCounter=...
java
public synchronized String getSubDomain() { if(m_imageUrlSubdomains==null || m_imageUrlSubdomains.length<=0) { return null; } final String result = m_imageUrlSubdomains[m_subdomainsCounter]; if(m_subdomainsCounter<m_imageUrlSubdomains.length-1) { m_subdomainsCounter++; } else { m_subdomainsCounter=...
[ "public", "synchronized", "String", "getSubDomain", "(", ")", "{", "if", "(", "m_imageUrlSubdomains", "==", "null", "||", "m_imageUrlSubdomains", ".", "length", "<=", "0", ")", "{", "return", "null", ";", "}", "final", "String", "result", "=", "m_imageUrlSubdo...
When several subdomains are available, get subdomain pointed by internal cycle counter on subdomains and increment this counter @return the subdomain string associated to current counter value.
[ "When", "several", "subdomains", "are", "available", "get", "subdomain", "pointed", "by", "internal", "cycle", "counter", "on", "subdomains", "and", "increment", "this", "counter" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaDataResource.java#L101-L115
59,268
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java
TileSourceFactory.getTileSource
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); }
java
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); }
[ "public", "static", "ITileSource", "getTileSource", "(", "final", "String", "aName", ")", "throws", "IllegalArgumentException", "{", "for", "(", "final", "ITileSource", "tileSource", ":", "mTileSources", ")", "{", "if", "(", "tileSource", ".", "name", "(", ")", ...
Get the tile source with the specified name. The tile source must be one of the registered sources as defined in the static list mTileSources of this class. @param aName the tile source name @return the tile source @throws IllegalArgumentException if tile source not found
[ "Get", "the", "tile", "source", "with", "the", "specified", "name", ".", "The", "tile", "source", "must", "be", "one", "of", "the", "registered", "sources", "as", "defined", "in", "the", "static", "list", "mTileSources", "of", "this", "class", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java#L30-L37
59,269
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java
TileSourceFactory.getTileSource
@Deprecated 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); }
java
@Deprecated 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); }
[ "@", "Deprecated", "public", "static", "ITileSource", "getTileSource", "(", "final", "int", "aOrdinal", ")", "throws", "IllegalArgumentException", "{", "for", "(", "final", "ITileSource", "tileSource", ":", "mTileSources", ")", "{", "if", "(", "tileSource", ".", ...
Get the tile source at the specified position. @param aOrdinal @return the tile source @throws IllegalArgumentException if tile source not found
[ "Get", "the", "tile", "source", "at", "the", "specified", "position", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java#L56-L64
59,270
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java
TileSourceFactory.removeTileSources
public static int removeTileSources(final String aRegex) { int n=0; for (int i=mTileSources.size()-1; i>=0; --i) { if (mTileSources.get(i).name().matches(aRegex)) { mTileSources.remove(i); ++n; } } return n; }
java
public static int removeTileSources(final String aRegex) { int n=0; for (int i=mTileSources.size()-1; i>=0; --i) { if (mTileSources.get(i).name().matches(aRegex)) { mTileSources.remove(i); ++n; } } return n; }
[ "public", "static", "int", "removeTileSources", "(", "final", "String", "aRegex", ")", "{", "int", "n", "=", "0", ";", "for", "(", "int", "i", "=", "mTileSources", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "--", "i", ")", "{", ...
removes any tile sources whose name matches the regular expression @param aRegex regular expression @return number of sources removed
[ "removes", "any", "tile", "sources", "whose", "name", "matches", "the", "regular", "expression" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java#L88-L97
59,271
osmdroid/osmdroid
osmdroid-server-jdk/src/main/java/org/osmdroid/server/jdk/TileServer.java
TileServer.startServer
private static void startServer() throws Exception { JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setResourceClasses(TileFetcher.class); List<Object> providers = new ArrayList<Object>(); // add custom providers if any providers.add(new org.apache.cxf.ja...
java
private static void startServer() throws Exception { JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setResourceClasses(TileFetcher.class); List<Object> providers = new ArrayList<Object>(); // add custom providers if any providers.add(new org.apache.cxf.ja...
[ "private", "static", "void", "startServer", "(", ")", "throws", "Exception", "{", "JAXRSServerFactoryBean", "sf", "=", "new", "JAXRSServerFactoryBean", "(", ")", ";", "sf", ".", "setResourceClasses", "(", "TileFetcher", ".", "class", ")", ";", "List", "<", "Ob...
this files up a CXF based Jetty server to host tile rest service @throws Exception
[ "this", "files", "up", "a", "CXF", "based", "Jetty", "server", "to", "host", "tile", "rest", "service" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-server-jdk/src/main/java/org/osmdroid/server/jdk/TileServer.java#L59-L75
59,272
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java
OsmdroidShapeMarkers.add
public void add(ShapeMarkers shapeMarkers) { for (Marker marker : shapeMarkers.getMarkers()) { add(marker, shapeMarkers); } }
java
public void add(ShapeMarkers shapeMarkers) { for (Marker marker : shapeMarkers.getMarkers()) { add(marker, shapeMarkers); } }
[ "public", "void", "add", "(", "ShapeMarkers", "shapeMarkers", ")", "{", "for", "(", "Marker", "marker", ":", "shapeMarkers", ".", "getMarkers", "(", ")", ")", "{", "add", "(", "marker", ",", "shapeMarkers", ")", ";", "}", "}" ]
Add all markers in the shape @param shapeMarkers
[ "Add", "all", "markers", "in", "the", "shape" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java#L86-L90
59,273
osmdroid/osmdroid
osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java
OsmdroidShapeMarkers.addMarkerAsPolyline
public static void addMarkerAsPolyline(Marker marker, List<Marker> markers) { GeoPoint position = marker.getPosition(); int insertLocation = markers.size(); if (markers.size() > 1) { double[] distances = new double[markers.size()]; insertLocation = 0; distance...
java
public static void addMarkerAsPolyline(Marker marker, List<Marker> markers) { GeoPoint position = marker.getPosition(); int insertLocation = markers.size(); if (markers.size() > 1) { double[] distances = new double[markers.size()]; insertLocation = 0; distance...
[ "public", "static", "void", "addMarkerAsPolyline", "(", "Marker", "marker", ",", "List", "<", "Marker", ">", "markers", ")", "{", "GeoPoint", "position", "=", "marker", ".", "getPosition", "(", ")", ";", "int", "insertLocation", "=", "markers", ".", "size", ...
Polyline add a marker in the list of markers to where it is closest to the the surrounding points @param marker @param markers
[ "Polyline", "add", "a", "marker", "in", "the", "list", "of", "markers", "to", "where", "it", "is", "closest", "to", "the", "the", "surrounding", "points" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java#L245-L288
59,274
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java
Marker.showInfoWindow
public void showInfoWindow(){ if (mInfoWindow == null) return; final int markerWidth = mIcon.getIntrinsicWidth(); final int markerHeight = mIcon.getIntrinsicHeight(); final int offsetX = (int)(markerWidth * (mIWAnchorU - mAnchorU)); final int offsetY = (int)(markerHeight * (mIWAnchorV - mAnchorV)); if (m...
java
public void showInfoWindow(){ if (mInfoWindow == null) return; final int markerWidth = mIcon.getIntrinsicWidth(); final int markerHeight = mIcon.getIntrinsicHeight(); final int offsetX = (int)(markerWidth * (mIWAnchorU - mAnchorU)); final int offsetY = (int)(markerHeight * (mIWAnchorV - mAnchorV)); if (m...
[ "public", "void", "showInfoWindow", "(", ")", "{", "if", "(", "mInfoWindow", "==", "null", ")", "return", ";", "final", "int", "markerWidth", "=", "mIcon", ".", "getIntrinsicWidth", "(", ")", ";", "final", "int", "markerHeight", "=", "mIcon", ".", "getIntr...
shows the info window, if it's open, this will close and reopen it
[ "shows", "the", "info", "window", "if", "it", "s", "open", "this", "will", "close", "and", "reopen", "it" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java#L298-L317
59,275
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java
Marker.onDetach
@Override public void onDetach(MapView mapView) { BitmapPool.getInstance().asyncRecycle(mIcon); mIcon=null; BitmapPool.getInstance().asyncRecycle(mImage); //cleanDefaults(); this.mOnMarkerClickListener=null; this.mOnMarkerDragListener=null; this.mResources=null; setRelatedObject(null); if (isInfoWind...
java
@Override public void onDetach(MapView mapView) { BitmapPool.getInstance().asyncRecycle(mIcon); mIcon=null; BitmapPool.getInstance().asyncRecycle(mImage); //cleanDefaults(); this.mOnMarkerClickListener=null; this.mOnMarkerDragListener=null; this.mResources=null; setRelatedObject(null); if (isInfoWind...
[ "@", "Override", "public", "void", "onDetach", "(", "MapView", "mapView", ")", "{", "BitmapPool", ".", "getInstance", "(", ")", ".", "asyncRecycle", "(", "mIcon", ")", ";", "mIcon", "=", "null", ";", "BitmapPool", ".", "getInstance", "(", ")", ".", "asyn...
Null out the static references when the MapView is detached to prevent memory leaks.
[ "Null", "out", "the", "static", "references", "when", "the", "MapView", "is", "detached", "to", "prevent", "memory", "leaks", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java#L342-L362
59,276
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/PointReducer.java
PointReducer.orthogonalDistance
public static double orthogonalDistance(GeoPoint point, GeoPoint lineStart, GeoPoint lineEnd) { double area = Math.abs( ( lineStart.getLatitude() * lineEnd.getLongitude() + lineEnd.getLatitude() * point.getLongitude() + point.getLatitude() ...
java
public static double orthogonalDistance(GeoPoint point, GeoPoint lineStart, GeoPoint lineEnd) { double area = Math.abs( ( lineStart.getLatitude() * lineEnd.getLongitude() + lineEnd.getLatitude() * point.getLongitude() + point.getLatitude() ...
[ "public", "static", "double", "orthogonalDistance", "(", "GeoPoint", "point", ",", "GeoPoint", "lineStart", ",", "GeoPoint", "lineEnd", ")", "{", "double", "area", "=", "Math", ".", "abs", "(", "(", "lineStart", ".", "getLatitude", "(", ")", "*", "lineEnd", ...
Calculate the orthogonal distance from the line joining the lineStart and lineEnd points to point @param point The point the distance is being calculated for @param lineStart The point that starts the line @param lineEnd The point that ends the line @return The distance in points coordinate system
[ "Calculate", "the", "orthogonal", "distance", "from", "the", "line", "joining", "the", "lineStart", "and", "lineEnd", "points", "to", "point" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/PointReducer.java#L134-L153
59,277
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/intro/StoragePreferenceFragment.java
StoragePreferenceFragment.onClick
@Override public void onClick(View v) { switch (v.getId()) { case R.id.buttonManualCacheEntry: { showManualEntry(); } break; case R.id.buttonSetCache: { showPickCacheFromList(); } break; } }
java
@Override public void onClick(View v) { switch (v.getId()) { case R.id.buttonManualCacheEntry: { showManualEntry(); } break; case R.id.buttonSetCache: { showPickCacheFromList(); } break; } }
[ "@", "Override", "public", "void", "onClick", "(", "View", "v", ")", "{", "switch", "(", "v", ".", "getId", "(", ")", ")", "{", "case", "R", ".", "id", ".", "buttonManualCacheEntry", ":", "{", "showManualEntry", "(", ")", ";", "}", "break", ";", "c...
END PERMISSION CHECK
[ "END", "PERMISSION", "CHECK" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/intro/StoragePreferenceFragment.java#L96-L110
59,278
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/FolderOverlay.java
FolderOverlay.closeAllInfoWindows
public void closeAllInfoWindows(){ for (Overlay overlay:mOverlayManager){ if (overlay instanceof FolderOverlay){ ((FolderOverlay)overlay).closeAllInfoWindows(); } else if (overlay instanceof OverlayWithIW){ ((OverlayWithIW)overlay).closeInfoWindow(); } } }
java
public void closeAllInfoWindows(){ for (Overlay overlay:mOverlayManager){ if (overlay instanceof FolderOverlay){ ((FolderOverlay)overlay).closeAllInfoWindows(); } else if (overlay instanceof OverlayWithIW){ ((OverlayWithIW)overlay).closeInfoWindow(); } } }
[ "public", "void", "closeAllInfoWindows", "(", ")", "{", "for", "(", "Overlay", "overlay", ":", "mOverlayManager", ")", "{", "if", "(", "overlay", "instanceof", "FolderOverlay", ")", "{", "(", "(", "FolderOverlay", ")", "overlay", ")", ".", "closeAllInfoWindows...
Close all opened InfoWindows of overlays it contains. This only operates on overlays that inherit from OverlayWithIW.
[ "Close", "all", "opened", "InfoWindows", "of", "overlays", "it", "contains", ".", "This", "only", "operates", "on", "overlays", "that", "inherit", "from", "OverlayWithIW", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/FolderOverlay.java#L117-L125
59,279
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/BingMapTileSource.java
BingMapTileSource.getMetaData
private ImageryMetaDataResource getMetaData() { Log.d(IMapView.LOGTAG, "getMetaData"); ImageryMetaDataResource returnValue = null; InputStream in = null; HttpURLConnection client = null; ByteArrayOutputStream dataStream = null; BufferedOutputStream out = null; t...
java
private ImageryMetaDataResource getMetaData() { Log.d(IMapView.LOGTAG, "getMetaData"); ImageryMetaDataResource returnValue = null; InputStream in = null; HttpURLConnection client = null; ByteArrayOutputStream dataStream = null; BufferedOutputStream out = null; t...
[ "private", "ImageryMetaDataResource", "getMetaData", "(", ")", "{", "Log", ".", "d", "(", "IMapView", ".", "LOGTAG", ",", "\"getMetaData\"", ")", ";", "ImageryMetaDataResource", "returnValue", "=", "null", ";", "InputStream", "in", "=", "null", ";", "HttpURLConn...
Gets the imagery meta from the REST service, or null if it fails
[ "Gets", "the", "imagery", "meta", "from", "the", "REST", "service", "or", "null", "if", "it", "fails" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/BingMapTileSource.java#L227-L288
59,280
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/NetworkLocationIgnorer.java
NetworkLocationIgnorer.shouldIgnore
public boolean shouldIgnore(final String pProvider, final long pTime) { if (LocationManager.GPS_PROVIDER.equals(pProvider)) { mLastGps = pTime; } else { if (pTime < mLastGps + Configuration.getInstance().getGpsWaitTime()) { return true; } } return false; }
java
public boolean shouldIgnore(final String pProvider, final long pTime) { if (LocationManager.GPS_PROVIDER.equals(pProvider)) { mLastGps = pTime; } else { if (pTime < mLastGps + Configuration.getInstance().getGpsWaitTime()) { return true; } } return false; }
[ "public", "boolean", "shouldIgnore", "(", "final", "String", "pProvider", ",", "final", "long", "pTime", ")", "{", "if", "(", "LocationManager", ".", "GPS_PROVIDER", ".", "equals", "(", "pProvider", ")", ")", "{", "mLastGps", "=", "pTime", ";", "}", "else"...
Whether we should ignore this location. @param pProvider the provider that provided the location @param pTime the time of the location @return true if we should ignore this location, false if not
[ "Whether", "we", "should", "ignore", "this", "location", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/NetworkLocationIgnorer.java#L30-L41
59,281
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ScaleBarOverlay.java
ScaleBarOverlay.adjustScaleBarLength
private double adjustScaleBarLength(double length) { long pow = 0; boolean feet = false; if (unitsOfMeasure == UnitsOfMeasure.imperial) { if (length >= GeoConstants.METERS_PER_STATUTE_MILE / 5) length = length / GeoConstants.METERS_PER_STATUTE_MILE; else { length = length * GeoConstants.FEET_PER_MET...
java
private double adjustScaleBarLength(double length) { long pow = 0; boolean feet = false; if (unitsOfMeasure == UnitsOfMeasure.imperial) { if (length >= GeoConstants.METERS_PER_STATUTE_MILE / 5) length = length / GeoConstants.METERS_PER_STATUTE_MILE; else { length = length * GeoConstants.FEET_PER_MET...
[ "private", "double", "adjustScaleBarLength", "(", "double", "length", ")", "{", "long", "pow", "=", "0", ";", "boolean", "feet", "=", "false", ";", "if", "(", "unitsOfMeasure", "==", "UnitsOfMeasure", ".", "imperial", ")", "{", "if", "(", "length", ">=", ...
Returns a reduced length that starts with 1, 2 or 5 and trailing zeros. If set to nautical or imperial the input will be transformed before and after the reduction so that the result holds in that respective unit. @param length length to round @return reduced, rounded (in m, nm or mi depending on setting) result
[ "Returns", "a", "reduced", "length", "that", "starts", "with", "1", "2", "or", "5", "and", "trailing", "zeros", ".", "If", "set", "to", "nautical", "or", "imperial", "the", "input", "will", "be", "transformed", "before", "and", "after", "the", "reduction",...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ScaleBarOverlay.java#L619-L662
59,282
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/util/LocationUtils.java
LocationUtils.getLastKnownLocation
public static Location getLastKnownLocation(final LocationManager pLocationManager) { if (pLocationManager == null) { return null; } final Location gpsLocation = getLastKnownLocation(pLocationManager, LocationManager.GPS_PROVIDER); final Location networkLocation = getLastKnownLocation(pLocationManager, Locat...
java
public static Location getLastKnownLocation(final LocationManager pLocationManager) { if (pLocationManager == null) { return null; } final Location gpsLocation = getLastKnownLocation(pLocationManager, LocationManager.GPS_PROVIDER); final Location networkLocation = getLastKnownLocation(pLocationManager, Locat...
[ "public", "static", "Location", "getLastKnownLocation", "(", "final", "LocationManager", "pLocationManager", ")", "{", "if", "(", "pLocationManager", "==", "null", ")", "{", "return", "null", ";", "}", "final", "Location", "gpsLocation", "=", "getLastKnownLocation",...
Get the most recent location from the GPS or Network provider. @return return the most recent location, or null if there's no known location
[ "Get", "the", "most", "recent", "location", "from", "the", "GPS", "or", "Network", "provider", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/LocationUtils.java#L21-L39
59,283
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java
Polygon.setInfoWindow
public void setInfoWindow(InfoWindow infoWindow){ if (mInfoWindow != null){ if (mInfoWindow.getRelatedObject()==this) mInfoWindow.setRelatedObject(null); } mInfoWindow = infoWindow; }
java
public void setInfoWindow(InfoWindow infoWindow){ if (mInfoWindow != null){ if (mInfoWindow.getRelatedObject()==this) mInfoWindow.setRelatedObject(null); } mInfoWindow = infoWindow; }
[ "public", "void", "setInfoWindow", "(", "InfoWindow", "infoWindow", ")", "{", "if", "(", "mInfoWindow", "!=", "null", ")", "{", "if", "(", "mInfoWindow", ".", "getRelatedObject", "(", ")", "==", "this", ")", "mInfoWindow", ".", "setRelatedObject", "(", "null...
Set the InfoWindow to be used. Default is a BasicInfoWindow, with the layout named "bonuspack_bubble". You can use this method either to use your own layout, or to use your own sub-class of InfoWindow. If you don't want any InfoWindow to open, you can set it to null.
[ "Set", "the", "InfoWindow", "to", "be", "used", ".", "Default", "is", "a", "BasicInfoWindow", "with", "the", "layout", "named", "bonuspack_bubble", ".", "You", "can", "use", "this", "method", "either", "to", "use", "your", "own", "layout", "or", "to", "use...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L144-L150
59,284
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java
Polygon.getHoles
public List<List<GeoPoint>> getHoles(){ List<List<GeoPoint>> result = new ArrayList<List<GeoPoint>>(mHoles.size()); for (LinearRing hole:mHoles){ result.add(hole.getPoints()); //TODO: completely wrong: // hole.getPoints() doesn't return a copy but a direct handler to the internal list. // - if geodesic,...
java
public List<List<GeoPoint>> getHoles(){ List<List<GeoPoint>> result = new ArrayList<List<GeoPoint>>(mHoles.size()); for (LinearRing hole:mHoles){ result.add(hole.getPoints()); //TODO: completely wrong: // hole.getPoints() doesn't return a copy but a direct handler to the internal list. // - if geodesic,...
[ "public", "List", "<", "List", "<", "GeoPoint", ">", ">", "getHoles", "(", ")", "{", "List", "<", "List", "<", "GeoPoint", ">>", "result", "=", "new", "ArrayList", "<", "List", "<", "GeoPoint", ">", ">", "(", "mHoles", ".", "size", "(", ")", ")", ...
returns a copy of the holes this polygon contains @return never null
[ "returns", "a", "copy", "of", "the", "holes", "this", "polygon", "contains" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L185-L194
59,285
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java
Polygon.pointsAsCircle
public static ArrayList<GeoPoint> pointsAsCircle(GeoPoint center, double radiusInMeters){ ArrayList<GeoPoint> circlePoints = new ArrayList<GeoPoint>(360/6); for (int f = 0; f < 360; f += 6){ GeoPoint onCircle = center.destinationPoint(radiusInMeters, f); circlePoints.add(onCircle); } return circlePoints; ...
java
public static ArrayList<GeoPoint> pointsAsCircle(GeoPoint center, double radiusInMeters){ ArrayList<GeoPoint> circlePoints = new ArrayList<GeoPoint>(360/6); for (int f = 0; f < 360; f += 6){ GeoPoint onCircle = center.destinationPoint(radiusInMeters, f); circlePoints.add(onCircle); } return circlePoints; ...
[ "public", "static", "ArrayList", "<", "GeoPoint", ">", "pointsAsCircle", "(", "GeoPoint", "center", ",", "double", "radiusInMeters", ")", "{", "ArrayList", "<", "GeoPoint", ">", "circlePoints", "=", "new", "ArrayList", "<", "GeoPoint", ">", "(", "360", "/", ...
Build a list of GeoPoint as a circle. @param center center of the circle @param radiusInMeters @return the list of GeoPoint
[ "Build", "a", "list", "of", "GeoPoint", "as", "a", "circle", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L201-L208
59,286
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java
Polygon.setDefaultInfoWindowLocation
protected void setDefaultInfoWindowLocation() { int s = mOutline.getPoints().size(); if (s == 0){ mInfoWindowLocation = new GeoPoint(0.0, 0.0); return; } //TODO: as soon as the polygon bounding box will be a class member, don't compute it again here. mInfoWindowLocation = mOutline.getCenter(null); }
java
protected void setDefaultInfoWindowLocation() { int s = mOutline.getPoints().size(); if (s == 0){ mInfoWindowLocation = new GeoPoint(0.0, 0.0); return; } //TODO: as soon as the polygon bounding box will be a class member, don't compute it again here. mInfoWindowLocation = mOutline.getCenter(null); }
[ "protected", "void", "setDefaultInfoWindowLocation", "(", ")", "{", "int", "s", "=", "mOutline", ".", "getPoints", "(", ")", ".", "size", "(", ")", ";", "if", "(", "s", "==", "0", ")", "{", "mInfoWindowLocation", "=", "new", "GeoPoint", "(", "0.0", ","...
Internal method used to ensure that the infowindow will have a default position in all cases, so that the user can call showInfoWindow even if no tap occured before. Currently, set the position on the center of the polygon bounding box.
[ "Internal", "method", "used", "to", "ensure", "that", "the", "infowindow", "will", "have", "a", "default", "position", "in", "all", "cases", "so", "that", "the", "user", "can", "call", "showInfoWindow", "even", "if", "no", "tap", "occured", "before", ".", ...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L335-L343
59,287
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/Projection.java
Projection.toPixelsFromProjected
@Deprecated public Point toPixelsFromProjected(final PointL in, final Point reuse) { final Point out = reuse != null ? reuse : new Point(); final double power = getProjectedPowerDifference(); final PointL tmp = new PointL(); getLongPixelsFromProjected(in, power, true, tmp); out.x = TileSystem.truncateToInt(t...
java
@Deprecated public Point toPixelsFromProjected(final PointL in, final Point reuse) { final Point out = reuse != null ? reuse : new Point(); final double power = getProjectedPowerDifference(); final PointL tmp = new PointL(); getLongPixelsFromProjected(in, power, true, tmp); out.x = TileSystem.truncateToInt(t...
[ "@", "Deprecated", "public", "Point", "toPixelsFromProjected", "(", "final", "PointL", "in", ",", "final", "Point", "reuse", ")", "{", "final", "Point", "out", "=", "reuse", "!=", "null", "?", "reuse", ":", "new", "Point", "(", ")", ";", "final", "double...
Performs the second computationally light part of the projection. @param in the PointL calculated by the {@link #toProjectedPixels(double, double, PointL)} @param reuse just pass null if you do not have a Point to be 'recycled'. @return the Point containing the coordinates of the initial GeoPoint passed to the {@link ...
[ "Performs", "the", "second", "computationally", "light", "part", "of", "the", "projection", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L291-L300
59,288
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/Projection.java
Projection.unrotateAndScalePoint
public Point unrotateAndScalePoint(int x, int y, Point reuse) { return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0); }
java
public Point unrotateAndScalePoint(int x, int y, Point reuse) { return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0); }
[ "public", "Point", "unrotateAndScalePoint", "(", "int", "x", ",", "int", "y", ",", "Point", "reuse", ")", "{", "return", "applyMatrixToPoint", "(", "x", ",", "y", ",", "reuse", ",", "mUnrotateAndScaleMatrix", ",", "mOrientation", "!=", "0", ")", ";", "}" ]
This will revert the current map's scaling and rotation for a point. This can be useful when drawing to a fixed location on the screen.
[ "This", "will", "revert", "the", "current", "map", "s", "scaling", "and", "rotation", "for", "a", "point", ".", "This", "can", "be", "useful", "when", "drawing", "to", "a", "fixed", "location", "on", "the", "screen", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L366-L368
59,289
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/Projection.java
Projection.rotateAndScalePoint
public Point rotateAndScalePoint(int x, int y, Point reuse) { return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0); }
java
public Point rotateAndScalePoint(int x, int y, Point reuse) { return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0); }
[ "public", "Point", "rotateAndScalePoint", "(", "int", "x", ",", "int", "y", ",", "Point", "reuse", ")", "{", "return", "applyMatrixToPoint", "(", "x", ",", "y", ",", "reuse", ",", "mRotateAndScaleMatrix", ",", "mOrientation", "!=", "0", ")", ";", "}" ]
This will apply the current map's scaling and rotation for a point. This can be useful when converting MotionEvents to a screen point.
[ "This", "will", "apply", "the", "current", "map", "s", "scaling", "and", "rotation", "for", "a", "point", ".", "This", "can", "be", "useful", "when", "converting", "MotionEvents", "to", "a", "screen", "point", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L374-L376
59,290
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/Projection.java
Projection.adjustOffsets
public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) { if (pPixel == null) { return; } final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null); final Point unRotatedActualPixel = toPixels(pGeoPoint, null); final long deltaX = unRotatedExpectedPixe...
java
public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) { if (pPixel == null) { return; } final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null); final Point unRotatedActualPixel = toPixels(pGeoPoint, null); final long deltaX = unRotatedExpectedPixe...
[ "public", "void", "adjustOffsets", "(", "final", "IGeoPoint", "pGeoPoint", ",", "final", "PointF", "pPixel", ")", "{", "if", "(", "pPixel", "==", "null", ")", "{", "return", ";", "}", "final", "Point", "unRotatedExpectedPixel", "=", "unrotateAndScalePoint", "(...
Adjust the offsets so that this geo point projects into that pixel @since 6.0.0
[ "Adjust", "the", "offsets", "so", "that", "this", "geo", "point", "projects", "into", "that", "pixel" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L687-L696
59,291
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/Projection.java
Projection.adjustOffsets
@Deprecated public void adjustOffsets(final BoundingBox pBoundingBox) { if (pBoundingBox == null) { return; } adjustOffsets(pBoundingBox.getLonWest(), pBoundingBox.getLonEast(), false, 0); adjustOffsets(pBoundingBox.getActualNorth(), pBoundingBox.getActualSouth(), true, 0); }
java
@Deprecated public void adjustOffsets(final BoundingBox pBoundingBox) { if (pBoundingBox == null) { return; } adjustOffsets(pBoundingBox.getLonWest(), pBoundingBox.getLonEast(), false, 0); adjustOffsets(pBoundingBox.getActualNorth(), pBoundingBox.getActualSouth(), true, 0); }
[ "@", "Deprecated", "public", "void", "adjustOffsets", "(", "final", "BoundingBox", "pBoundingBox", ")", "{", "if", "(", "pBoundingBox", "==", "null", ")", "{", "return", ";", "}", "adjustOffsets", "(", "pBoundingBox", ".", "getLonWest", "(", ")", ",", "pBoun...
Adjust the offsets so that either this bounding box is bigger than the screen and contains it or it is smaller and it is centered @since 6.0.0 @deprecated Use {@link #adjustOffsets(double, double, boolean, int)} instead
[ "Adjust", "the", "offsets", "so", "that", "either", "this", "bounding", "box", "is", "bigger", "than", "the", "screen", "and", "contains", "it", "or", "it", "is", "smaller", "and", "it", "is", "centered" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L705-L712
59,292
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/QuadTreeTileSource.java
QuadTreeTileSource.quadTree
protected String quadTree(final long pMapTileIndex) { final StringBuilder quadKey = new StringBuilder(); for (int i = MapTileIndex.getZoom(pMapTileIndex); i > 0; i--) { int digit = 0; final int mask = 1 << (i - 1); if ((MapTileIndex.getX(pMapTileIndex) & mask) != 0) digit += 1; if ((MapTileIndex.get...
java
protected String quadTree(final long pMapTileIndex) { final StringBuilder quadKey = new StringBuilder(); for (int i = MapTileIndex.getZoom(pMapTileIndex); i > 0; i--) { int digit = 0; final int mask = 1 << (i - 1); if ((MapTileIndex.getX(pMapTileIndex) & mask) != 0) digit += 1; if ((MapTileIndex.get...
[ "protected", "String", "quadTree", "(", "final", "long", "pMapTileIndex", ")", "{", "final", "StringBuilder", "quadKey", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "MapTileIndex", ".", "getZoom", "(", "pMapTileIndex", ")", ";", ...
Converts TMS tile coordinates to QuadTree @param pMapTileIndex The tile coordinates to convert @return The QuadTree as String.
[ "Converts", "TMS", "tile", "coordinates", "to", "QuadTree" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/QuadTreeTileSource.java#L26-L39
59,293
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java
MapTileProviderBase.mapTileRequestFailed
@Override public void mapTileRequestFailed(final MapTileRequestState pState) { if (mTileNotFoundImage!=null) { putTileIntoCache(pState.getMapTile(), mTileNotFoundImage, ExpirableBitmapDrawable.NOT_FOUND); for (final Handler handler : mTileRequestCompleteHandlers) { if (handler != null) { handler.send...
java
@Override public void mapTileRequestFailed(final MapTileRequestState pState) { if (mTileNotFoundImage!=null) { putTileIntoCache(pState.getMapTile(), mTileNotFoundImage, ExpirableBitmapDrawable.NOT_FOUND); for (final Handler handler : mTileRequestCompleteHandlers) { if (handler != null) { handler.send...
[ "@", "Override", "public", "void", "mapTileRequestFailed", "(", "final", "MapTileRequestState", "pState", ")", "{", "if", "(", "mTileNotFoundImage", "!=", "null", ")", "{", "putTileIntoCache", "(", "pState", ".", "getMapTile", "(", ")", ",", "mTileNotFoundImage", ...
Called by implementation class methods indicating that they have failed to retrieve the requested map tile. a MAPTILE_FAIL_ID message is sent. @param pState the map tile request state object
[ "Called", "by", "implementation", "class", "methods", "indicating", "that", "they", "have", "failed", "to", "retrieve", "the", "requested", "map", "tile", ".", "a", "MAPTILE_FAIL_ID", "message", "is", "sent", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java#L173-L193
59,294
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java
MapTileProviderBase.mapTileRequestExpiredTile
@Override public void mapTileRequestExpiredTile(MapTileRequestState pState, Drawable pDrawable) { putTileIntoCache(pState.getMapTile(), pDrawable, ExpirableBitmapDrawable.getState(pDrawable)); // tell our caller we've finished and it should update its view for (final Handler handler : mTileRequestCompleteHandle...
java
@Override public void mapTileRequestExpiredTile(MapTileRequestState pState, Drawable pDrawable) { putTileIntoCache(pState.getMapTile(), pDrawable, ExpirableBitmapDrawable.getState(pDrawable)); // tell our caller we've finished and it should update its view for (final Handler handler : mTileRequestCompleteHandle...
[ "@", "Override", "public", "void", "mapTileRequestExpiredTile", "(", "MapTileRequestState", "pState", ",", "Drawable", "pDrawable", ")", "{", "putTileIntoCache", "(", "pState", ".", "getMapTile", "(", ")", ",", "pDrawable", ",", "ExpirableBitmapDrawable", ".", "getS...
Called by implementation class methods indicating that they have produced an expired result that can be used but better results may be delivered later. The tile is added to the cache, and a MAPTILE_SUCCESS_ID message is sent. @param pState the map tile request state object @param pDrawable the Drawable of the map tile
[ "Called", "by", "implementation", "class", "methods", "indicating", "that", "they", "have", "produced", "an", "expired", "result", "that", "can", "be", "used", "but", "better", "results", "may", "be", "delivered", "later", ".", "The", "tile", "is", "added", ...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java#L217-L231
59,295
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java
MapTileProviderBase.rescaleCache
public void rescaleCache(final Projection pProjection, final double pNewZoomLevel, final double pOldZoomLevel, final Rect pViewPort) { if (TileSystem.getInputTileZoomLevel(pNewZoomLevel) == TileSystem.getInputTileZoomLevel(pOldZoomLevel)) { return; } final long startMs = System.currentTimeMillis(); if (...
java
public void rescaleCache(final Projection pProjection, final double pNewZoomLevel, final double pOldZoomLevel, final Rect pViewPort) { if (TileSystem.getInputTileZoomLevel(pNewZoomLevel) == TileSystem.getInputTileZoomLevel(pOldZoomLevel)) { return; } final long startMs = System.currentTimeMillis(); if (...
[ "public", "void", "rescaleCache", "(", "final", "Projection", "pProjection", ",", "final", "double", "pNewZoomLevel", ",", "final", "double", "pOldZoomLevel", ",", "final", "Rect", "pViewPort", ")", "{", "if", "(", "TileSystem", ".", "getInputTileZoomLevel", "(", ...
Recreate the cache using scaled versions of the tiles currently in it @param pNewZoomLevel the zoom level that we need now @param pOldZoomLevel the previous zoom level that we should get the tiles to rescale @param pViewPort the view port we need tiles for
[ "Recreate", "the", "cache", "using", "scaled", "versions", "of", "the", "tiles", "currently", "in", "it" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java#L319-L344
59,296
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java
ItemizedOverlay.onDrawItem
protected boolean onDrawItem(final Canvas canvas, final Item item, final Point curScreenCoords, final Projection pProjection) { final int state = (mDrawFocusedItem && (mFocusedItem == item) ? OverlayItem.ITEM_STATE_FOCUSED_MASK : 0); final Drawable marker = (item.getMarker(state) == null) ? getDefaultMa...
java
protected boolean onDrawItem(final Canvas canvas, final Item item, final Point curScreenCoords, final Projection pProjection) { final int state = (mDrawFocusedItem && (mFocusedItem == item) ? OverlayItem.ITEM_STATE_FOCUSED_MASK : 0); final Drawable marker = (item.getMarker(state) == null) ? getDefaultMa...
[ "protected", "boolean", "onDrawItem", "(", "final", "Canvas", "canvas", ",", "final", "Item", "item", ",", "final", "Point", "curScreenCoords", ",", "final", "Projection", "pProjection", ")", "{", "final", "int", "state", "=", "(", "mDrawFocusedItem", "&&", "(...
Draws an item located at the provided screen coordinates to the canvas. @param canvas what the item is drawn upon @param item the item to be drawn @param curScreenCoords @param pProjection @return true if the item was actually drawn
[ "Draws", "an", "item", "located", "at", "the", "provided", "screen", "coordinates", "to", "the", "canvas", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L197-L230
59,297
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java
ItemizedOverlay.getDisplayedItems
public List<Item> getDisplayedItems() { final List<Item> result = new ArrayList<>(); if (mInternalItemDisplayedList == null) { return result; } for (int i = 0 ; i < mInternalItemDisplayedList.length ; i ++) { if (mInternalItemDisplayedList[i]) { result.add(getItem(i)); } } return result; }
java
public List<Item> getDisplayedItems() { final List<Item> result = new ArrayList<>(); if (mInternalItemDisplayedList == null) { return result; } for (int i = 0 ; i < mInternalItemDisplayedList.length ; i ++) { if (mInternalItemDisplayedList[i]) { result.add(getItem(i)); } } return result; }
[ "public", "List", "<", "Item", ">", "getDisplayedItems", "(", ")", "{", "final", "List", "<", "Item", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "if", "(", "mInternalItemDisplayedList", "==", "null", ")", "{", "return", "result", ";", ...
Get the list of all the items that are currently drawn on the canvas. The obvious use case is a "share" or "export" button on a map, restricted to what is displayed. The order of the items is kept @since 5.6.7 @return the items that have actually been drawn
[ "Get", "the", "list", "of", "all", "the", "items", "that", "are", "currently", "drawn", "on", "the", "canvas", ".", "The", "obvious", "use", "case", "is", "a", "share", "or", "export", "button", "on", "a", "map", "restricted", "to", "what", "is", "disp...
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L240-L251
59,298
osmdroid/osmdroid
osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java
ItemizedOverlay.calculateItemRect
protected Rect calculateItemRect(Item item, Point coords, Rect reuse) { final Rect out = reuse != null ? reuse : new Rect(); HotspotPlace hotspot = item.getMarkerHotspot(); if (hotspot == null) { hotspot = HotspotPlace.BOTTOM_CENTER; } final int state = (mDrawFocusedItem && (mFocusedItem == item) ? Overl...
java
protected Rect calculateItemRect(Item item, Point coords, Rect reuse) { final Rect out = reuse != null ? reuse : new Rect(); HotspotPlace hotspot = item.getMarkerHotspot(); if (hotspot == null) { hotspot = HotspotPlace.BOTTOM_CENTER; } final int state = (mDrawFocusedItem && (mFocusedItem == item) ? Overl...
[ "protected", "Rect", "calculateItemRect", "(", "Item", "item", ",", "Point", "coords", ",", "Rect", "reuse", ")", "{", "final", "Rect", "out", "=", "reuse", "!=", "null", "?", "reuse", ":", "new", "Rect", "(", ")", ";", "HotspotPlace", "hotspot", "=", ...
Calculates the screen rect for an item. @param item @param coords @param reuse @return
[ "Calculates", "the", "screen", "rect", "for", "an", "item", "." ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L404-L481
59,299
osmdroid/osmdroid
OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/HeatMap.java
HeatMap.createPolygon
private Overlay createPolygon(BoundingBox key, Integer value, int redthreshold, int orangethreshold) { Polygon polygon = new Polygon(mMapView); if (value < orangethreshold) polygon.setFillColor(Color.parseColor(alpha + yellow)); else if (value < redthreshold) polygon.setF...
java
private Overlay createPolygon(BoundingBox key, Integer value, int redthreshold, int orangethreshold) { Polygon polygon = new Polygon(mMapView); if (value < orangethreshold) polygon.setFillColor(Color.parseColor(alpha + yellow)); else if (value < redthreshold) polygon.setF...
[ "private", "Overlay", "createPolygon", "(", "BoundingBox", "key", ",", "Integer", "value", ",", "int", "redthreshold", ",", "int", "orangethreshold", ")", "{", "Polygon", "polygon", "=", "new", "Polygon", "(", "mMapView", ")", ";", "if", "(", "value", "<", ...
converts the bounding box into a color filled polygon @param key @param value @param redthreshold @param orangethreshold @return
[ "converts", "the", "bounding", "box", "into", "a", "color", "filled", "polygon" ]
3b178b2f078497dd88c137110e87aafe45ad2b16
https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/HeatMap.java#L289-L312