public final class TerrainCollection extends Object implements Collection<TerrainOverlay>, Iterable<TerrainOverlay>, IDisposable
TerrainOverlay
objects.Modifier and Type | Method and Description |
---|---|
TerrainOverlay |
add(String uri)
|
boolean |
add(TerrainOverlay terrainOverlay)
Adds
terrainOverlay to the collection. |
TerrainOverlay |
add(URI uri)
Creates a
TerrainOverlay from the uri and adds it to the collection. |
void |
addAddComplete(EventHandler<TerrainOverlayAddCompleteEventArgs> value)
Adds a handler for an event that is raised when an asynchronous add is completed.
|
boolean |
addAll(Collection<? extends TerrainOverlay> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
|
TerrainOverlay |
addAsync(String uri)
Creates a
TerrainOverlay from the uri , which represents a URI , and adds it to the collection asynchronously. |
void |
addAsync(TerrainOverlay terrainOverlay)
Adds
terrainOverlay to the collection asynchronously. |
TerrainOverlay |
addAsync(URI uri)
Creates a
TerrainOverlay from the uri and adds it to the collection asynchronously. |
void |
addRange(Iterable<TerrainOverlay> overlays)
Adds the elements of the specified collection to the end of the
TerrainCollection . |
void |
addRangeAsync(Iterable<TerrainOverlay> overlays)
Adds the elements of the specified collection to the end of the
TerrainCollection asynchronously. |
void |
bringToFront(TerrainOverlay terrainOverlay)
Brings the
TerrainOverlay to the front of the collection so it is rendered first or on the bottom. |
void |
clear()
Removes all
TerrainOverlay objects from the collection. |
boolean |
contains(Object terrainOverlay)
Checks the presence of a
TerrainOverlay in the collection. |
boolean |
contains(String stringUri)
Checks the presence of a
TerrainOverlay with the specified Uri in the collection. |
boolean |
contains(URI uri)
Checks the presence of a
TerrainOverlay with the specified URI in the collection. |
boolean |
containsAll(Collection<?> c)
Returns true if this collection contains all of the elements
in the specified collection.
|
void |
copyTo(TerrainOverlay[] toArray,
int startingIndex) |
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting
unmanaged resources.
|
protected void |
dispose(boolean disposing) |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
TerrainOverlay |
get(int index)
Gets the
TerrainOverlay at the specified index. |
boolean |
getIsReadOnly()
Gets whether or not the collection is read only.
|
int |
indexOf(String stringUri)
Gets the index of the
TerrainOverlay with the specified Uri. |
int |
indexOf(TerrainOverlay terrainOverlay)
Gets the index of the specified
TerrainOverlay . |
int |
indexOf(URI uri)
Gets the index of the
TerrainOverlay with the specified URI . |
boolean |
isEmpty()
Returns true if this collection contains no elements.
|
Iterator<TerrainOverlay> |
iterator()
Constructs an iterator that can be used to iterate the collection.
|
void |
move(int index,
int newPosition)
Moves the
TerrainOverlay at the specified index to the specified position. |
void |
move(TerrainOverlay terrainOverlay,
int newPosition)
Moves the
TerrainOverlay to the specified position. |
boolean |
remove(Object terrainOverlay)
Removes a
TerrainOverlay from the collection. |
void |
removeAddComplete(EventHandler<TerrainOverlayAddCompleteEventArgs> value)
Removes a handler for an event that is raised when an asynchronous add is completed.
|
boolean |
removeAll(Collection<?> c)
Removes all of this collection's elements that are also contained in the
specified collection (optional operation).
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
|
void |
sendToBack(TerrainOverlay terrainOverlay)
Sends the
TerrainOverlay to the back of the collection so it is rendered last or on the top. |
int |
size()
Gets the number of
TerrainOverlay objects in the collection. |
void |
swap(int index1,
int index2)
Swaps the position of two
TerrainOverlay objects at the specified indices. |
void |
swap(TerrainOverlay terrainOverlay1,
TerrainOverlay terrainOverlay2)
Swaps the position of two
TerrainOverlay objects. |
Object[] |
toArray()
Returns an array containing all of the elements in this collection.
|
<T> T[] |
toArray(T[] a)
Returns an array containing all of the elements in this collection;
the runtime type of the returned array is that of the specified array.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
close
protected void finalize() throws Throwable
java.lang.Object
finalize
method to dispose of
system resources or to perform other cleanup.
The general contract of finalize
is that it is invoked
if and when the Java™ virtual
machine has determined that there is no longer any
means by which this object can be accessed by any thread that has
not yet died, except as a result of an action taken by the
finalization of some other object or class which is ready to be
finalized. The finalize
method may take any action, including
making this object available again to other threads; the usual purpose
of finalize
, however, is to perform cleanup actions before
the object is irrevocably discarded. For example, the finalize method
for an object that represents an input/output connection might perform
explicit I/O transactions to break the connection before the object is
permanently discarded.
The finalize
method of class Object
performs no
special action; it simply returns normally. Subclasses of
Object
may override this definition.
The Java programming language does not guarantee which thread will
invoke the finalize
method for any given object. It is
guaranteed, however, that the thread that invokes finalize will not
be holding any user-visible synchronization locks when finalize is
invoked. If an uncaught exception is thrown by the finalize method,
the exception is ignored and finalization of that object terminates.
After the finalize
method has been invoked for an object, no
further action is taken until the Java virtual machine has again
determined that there is no longer any means by which this object can
be accessed by any thread that has not yet died, including possible
actions by other objects or classes which are ready to be finalized,
at which point the object may be discarded.
The finalize
method is never invoked more than once by a Java
virtual machine for any given object.
Any exception thrown by the finalize
method causes
the finalization of this object to be halted, but is otherwise
ignored.
finalize
in class Object
Throwable
- the Exception
raised by this methodWeakReference
,
PhantomReference
public final void dispose()
IDisposable
dispose
in interface IDisposable
protected void dispose(boolean disposing)
public boolean getIsReadOnly()
public void addAddComplete(EventHandler<TerrainOverlayAddCompleteEventArgs> value)
value
- The event handler.public void removeAddComplete(EventHandler<TerrainOverlayAddCompleteEventArgs> value)
value
- The event handler.public TerrainOverlay get(int index)
TerrainOverlay
at the specified index.public Iterator<TerrainOverlay> iterator()
iterator
in interface Iterable<TerrainOverlay>
iterator
in interface Collection<TerrainOverlay>
public boolean contains(Object terrainOverlay)
TerrainOverlay
in the collection.contains
in interface Collection<TerrainOverlay>
terrainOverlay
- The TerrainOverlay
to search for in the collection.terrainOverlay
is in the collection.public final boolean contains(URI uri)
TerrainOverlay
with the specified URI
in the collection.uri
- The URI
to search for in the collection.TerrainOverlay
with the specified URI
is in the collection.public final boolean contains(String stringUri)
TerrainOverlay
with the specified Uri in the collection.stringUri
- The String
that contains the Uri to search for in the collection.TerrainOverlay
with the specified Uri is in the collection.public boolean remove(Object terrainOverlay)
TerrainOverlay
from the collection.remove
in interface Collection<TerrainOverlay>
terrainOverlay
- The TerrainOverlay
to be removed.terrainOverlay
was found and successfully removed from the collection.public void clear()
TerrainOverlay
objects from the collection.clear
in interface Collection<TerrainOverlay>
public boolean add(TerrainOverlay terrainOverlay)
terrainOverlay
to the collection.add
in interface Collection<TerrainOverlay>
terrainOverlay
- The TerrainOverlay
to be added to the collection.public final void addAsync(TerrainOverlay terrainOverlay)
terrainOverlay
to the collection asynchronously.terrainOverlay
- The TerrainOverlay
to be added to the collection.public final void addRange(Iterable<TerrainOverlay> overlays)
TerrainCollection
.overlays
- A group of TerrainOverlay
objects to be added to the collection.public final void addRangeAsync(Iterable<TerrainOverlay> overlays)
TerrainCollection
asynchronously.overlays
- A group of TerrainOverlay
objects to be added to the collection.public final int indexOf(TerrainOverlay terrainOverlay)
TerrainOverlay
.terrainOverlay
- The TerrainOverlay
to search for in the collection.terrainOverlay
in the collection. -1 if it isn't found.public final int indexOf(URI uri)
TerrainOverlay
with the specified URI
.uri
- The URI
to search for in the collection.TerrainOverlay
with the specified URI
in the collection. -1 if it isn't found.public final int indexOf(String stringUri)
TerrainOverlay
with the specified Uri.stringUri
- The String
containing the Uri to search for in the collection.TerrainOverlay
with the specified Uri in the collection. -1 if it isn't found.public final TerrainOverlay add(URI uri)
TerrainOverlay
from the uri
and adds it to the collection.uri
- The URI
of the TerrainOverlay
. The TerrainOverlay
must be of a recognized format.TerrainOverlay
that was created and added to the collectionpublic final TerrainOverlay addAsync(URI uri)
TerrainOverlay
from the uri
and adds it to the collection asynchronously.uri
- The URI
of the TerrainOverlay
. The TerrainOverlay
must be of a recognized format.TerrainOverlay
that was created and added to the collectionpublic final TerrainOverlay add(String uri)
uri
- The String
that represents the URI
of the TerrainOverlay
. The TerrainOverlay
must be of a recognized format.TerrainOverlay
that was created and added to the collectionpublic final TerrainOverlay addAsync(String uri)
TerrainOverlay
from the uri
, which represents a URI
, and adds it to the collection asynchronously.uri
- The String
that represents the URI
of the TerrainOverlay
. The TerrainOverlay
must be of a recognized format.TerrainOverlay
that was created and added to the collectionpublic final void swap(TerrainOverlay terrainOverlay1, TerrainOverlay terrainOverlay2)
TerrainOverlay
objects.terrainOverlay1
- The first TerrainOverlay
object.terrainOverlay2
- The second TerrainOverlay
object.public final void swap(int index1, int index2)
TerrainOverlay
objects at the specified indices.index1
- The index of the first TerrainOverlay
.index2
- The index of the second TerrainOverlay
.public final void move(TerrainOverlay terrainOverlay, int newPosition)
TerrainOverlay
to the specified position.terrainOverlay
- The TerrainOverlay
to move.newPosition
- The new position of the terrainOverlay
.public final void move(int index, int newPosition)
TerrainOverlay
at the specified index to the specified position.index
- The index of the TerrainOverlay
to move.newPosition
- The new position of the TerrainOverlay
.public final void bringToFront(TerrainOverlay terrainOverlay)
TerrainOverlay
to the front of the collection so it is rendered first or on the bottom.terrainOverlay
- The TerrainOverlay
to bring to the front of the collection.public final void sendToBack(TerrainOverlay terrainOverlay)
TerrainOverlay
to the back of the collection so it is rendered last or on the top.terrainOverlay
- The TerrainOverlay
to send to the back of the collection.public int size()
TerrainOverlay
objects in the collection.size
in interface Collection<TerrainOverlay>
public boolean isEmpty()
java.util.Collection
isEmpty
in interface Collection<TerrainOverlay>
public Object[] toArray()
java.util.Collection
The returned array will be "safe" in that no references to it are maintained by this collection. (In other words, this method must allocate a new array even if this collection is backed by an array). The caller is thus free to modify the returned array.
This method acts as bridge between array-based and collection-based APIs.
toArray
in interface Collection<TerrainOverlay>
public <T> T[] toArray(T[] a)
java.util.Collection
If this collection fits in the specified array with room to spare (i.e., the array has more elements than this collection), the element in the array immediately following the end of the collection is set to null. (This is useful in determining the length of this collection only if the caller knows that this collection does not contain any null elements.)
If this collection makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order.
Like the Collection.toArray()
method, this method acts as bridge between
array-based and collection-based APIs. Further, this method allows
precise control over the runtime type of the output array, and may,
under certain circumstances, be used to save allocation costs.
Suppose x is a collection known to contain only strings. The following code can be used to dump the collection into a newly allocated array of String:
String[] y = x.toArray(new String[0]);Note that toArray(new Object[0]) is identical in function to toArray().
toArray
in interface Collection<TerrainOverlay>
T
- the runtime type of the array to contain the collectiona
- the array into which the elements of this collection are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose.public boolean addAll(Collection<? extends TerrainOverlay> c)
java.util.Collection
addAll
in interface Collection<TerrainOverlay>
c
- collection containing elements to be added to this collectionCollection.add(Object)
public boolean removeAll(Collection<?> c)
java.util.Collection
removeAll
in interface Collection<TerrainOverlay>
c
- collection containing elements to be removed from this collectionCollection.remove(Object)
,
Collection.contains(Object)
public boolean retainAll(Collection<?> c)
java.util.Collection
retainAll
in interface Collection<TerrainOverlay>
c
- collection containing elements to be retained in this collectionCollection.remove(Object)
,
Collection.contains(Object)
public boolean containsAll(Collection<?> c)
java.util.Collection
containsAll
in interface Collection<TerrainOverlay>
c
- collection to be checked for containment in this collectionCollection.contains(Object)
public void copyTo(TerrainOverlay[] toArray, int startingIndex)