com.esri.map
Class ResolutionList

java.lang.Object
  extended by com.esri.map.ResolutionList
All Implemented Interfaces:
Iterable<Double>, Collection<Double>

public class ResolutionList
extends Object
implements Collection<Double>

This class is used to contain a list of map resolution values that can be used to set fixed zoom levels in a JMap. The values are ordered from lowest resolution (most zoomed out or largest resolution number) to highest resolution (most zoomed in or smallest resolution number).

In addition to the standard Collection methods, this class also allows resolution values to be added from a given layer by calling addFromLayer(Layer).


Constructor Summary
ResolutionList()
           
 
Method Summary
 boolean add(Double e)
           
 boolean addAll(Collection<? extends Double> c)
           
 void addFromLayer(Layer layer)
          Adds all the resolution values contained in the given layer
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 Object getSyncObject()
          Gets the sync object to be used when accessing this class's iterator.
 Double higher(Double resolution)
          Get the next highest value from the value given.
 Double highest()
          Get the highest resolution in the list (most zoomed in)
 boolean isEmpty()
           
 Iterator<Double> iterator()
          This iterator will return the resolution values ordered from lowest resolution (most zoomed out or largest resolution number) to highest resolution (most zoomed in or smallest resolution number).
 Double lower(Double resolution)
          Get the next lowest value from the value given.
 Double lowest()
          Get the lowest resolution in the list (most zoomed out)
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

ResolutionList

public ResolutionList()
Method Detail

getSyncObject

public Object getSyncObject()
Gets the sync object to be used when accessing this class's iterator.

Returns:
the sync object

size

public int size()
Specified by:
size in interface Collection<Double>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<Double>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<Double>

iterator

public Iterator<Double> iterator()
This iterator will return the resolution values ordered from lowest resolution (most zoomed out or largest resolution number) to highest resolution (most zoomed in or smallest resolution number).

To guard against the resolution being edited, it is good practice to call this in a synchronized block synchronized on the object returned by getSyncObject().

Specified by:
iterator in interface Iterable<Double>
Specified by:
iterator in interface Collection<Double>
See Also:
Collection.iterator()

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<Double>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<Double>

add

public boolean add(Double e)
Specified by:
add in interface Collection<Double>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<Double>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<Double>

addAll

public boolean addAll(Collection<? extends Double> c)
Specified by:
addAll in interface Collection<Double>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<Double>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<Double>

clear

public void clear()
Specified by:
clear in interface Collection<Double>

addFromLayer

public void addFromLayer(Layer layer)
Adds all the resolution values contained in the given layer

Parameters:
layer - the layer to add resolution values from

lower

public Double lower(Double resolution)
Get the next lowest value from the value given.

Parameters:
resolution - the resolution to search from
Returns:
the next lowest value

higher

public Double higher(Double resolution)
Get the next highest value from the value given.

Parameters:
resolution - the resolution to search from
Returns:
the next highest value

highest

public Double highest()
Get the highest resolution in the list (most zoomed in)

Returns:
highest resolution in list

lowest

public Double lowest()
Get the lowest resolution in the list (most zoomed out)

Returns:
lowest resolution in list


Copyright © 2012. All Rights Reserved.