NASA World Wind

gov.nasa.worldwind.util
Class Tile

java.lang.Object
  extended by gov.nasa.worldwind.util.Tile
All Implemented Interfaces:
Cacheable, java.lang.Comparable<Tile>
Direct Known Subclasses:
TextureTile

public class Tile
extends java.lang.Object
implements java.lang.Comparable<Tile>, Cacheable


Constructor Summary
Tile(Sector sector)
           
Tile(Sector sector, Level level)
           
Tile(Sector sector, Level level, int row, int column)
           
 
Method Summary
 int compareTo(Tile tile)
           
static int computeColumn(Angle delta, Angle longitude)
          Computes the column index of a longitude in the global tile grid corresponding to a specified grid interval.
static Angle computeColumnLongitude(int column, Angle delta)
          Determines the minimum longitude of a column in the global tile grid corresponding to a specified grid interval.
static int computeRow(Angle delta, Angle latitude)
          Computes the row index of a latitude in the global tile grid corresponding to a specified grid interval.
static Angle computeRowLatitude(int row, Angle delta)
          Determines the minimum latitude of a row in the global tile grid corresponding to a specified grid interval.
 boolean equals(java.lang.Object o)
           
 java.lang.String getCacheName()
           
 int getColumn()
           
 java.lang.String getFormatSuffix()
           
 java.lang.String getLabel()
           
 Level getLevel()
           
 java.lang.String getLevelName()
           
 int getLevelNumber()
           
 java.lang.String getPath()
           
 java.lang.String getPathBase()
           
 double getPriority()
           
 java.net.URL getResourceURL()
           
 java.net.URL getResourceURL(java.lang.String imageFormat)
           
 int getRow()
           
 Sector getSector()
           
 long getSizeInBytes()
          Retrieves the approximate size of this object in bytes.
 TileKey getTileKey()
           
 int hashCode()
           
 void setPriority(double priority)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tile

public Tile(Sector sector)

Tile

public Tile(Sector sector,
            Level level)

Tile

public Tile(Sector sector,
            Level level,
            int row,
            int column)
Method Detail

compareTo

public int compareTo(Tile tile)
Specified by:
compareTo in interface java.lang.Comparable<Tile>

computeColumn

public static int computeColumn(Angle delta,
                                Angle longitude)
Computes the column index of a longitude in the global tile grid corresponding to a specified grid interval.

Parameters:
delta - the grid interval
longitude - the longitude for which to compute the column index
Returns:
the column index of the column containing the specified latitude
Throws:
java.lang.IllegalArgumentException - if delta is null or non-positive, or longitude is null, greater than positive 180 degrees, or less than negative 180 degrees

computeColumnLongitude

public static Angle computeColumnLongitude(int column,
                                           Angle delta)
Determines the minimum longitude of a column in the global tile grid corresponding to a specified grid interval.

Parameters:
column - the row index of the row in question
delta - the grid interval
Returns:
the minimum longitude of the tile corresponding to the specified column
Throws:
java.lang.IllegalArgumentException - if the grid interval (delta) is null or zero or the column index is negative.

computeRow

public static int computeRow(Angle delta,
                             Angle latitude)
Computes the row index of a latitude in the global tile grid corresponding to a specified grid interval.

Parameters:
delta - the grid interval
latitude - the latitude for which to compute the row index
Returns:
the row index of the row containing the specified latitude
Throws:
java.lang.IllegalArgumentException - if delta is null or non-positive, or latitude is null, greater than positive 90 degrees, or less than negative 90 degrees

computeRowLatitude

public static Angle computeRowLatitude(int row,
                                       Angle delta)
Determines the minimum latitude of a row in the global tile grid corresponding to a specified grid interval.

Parameters:
row - the row index of the row in question
delta - the grid interval
Returns:
the minimum latitude of the tile corresponding to the specified row
Throws:
java.lang.IllegalArgumentException - if the grid interval (delta) is null or zero or the row index is negative.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getCacheName

public final java.lang.String getCacheName()

getColumn

public final int getColumn()

getFormatSuffix

public final java.lang.String getFormatSuffix()

getLabel

public java.lang.String getLabel()

getLevel

public Level getLevel()

getLevelName

public final java.lang.String getLevelName()

getLevelNumber

public final int getLevelNumber()

getPath

public java.lang.String getPath()

getPathBase

public java.lang.String getPathBase()

getPriority

public double getPriority()

getResourceURL

public java.net.URL getResourceURL()
                            throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getResourceURL

public java.net.URL getResourceURL(java.lang.String imageFormat)
                            throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

getRow

public final int getRow()

getSector

public final Sector getSector()

getSizeInBytes

public long getSizeInBytes()
Description copied from interface: Cacheable
Retrieves the approximate size of this object in bytes. Implementors are encouraged to calculate the exact size for smaller objects, but use approximate values for objects that include such large components that the approximation would produce an error so small that the extra computation would be wasteful.

Specified by:
getSizeInBytes in interface Cacheable
Returns:
this Cacheable object's size in bytes

getTileKey

public final TileKey getTileKey()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

setPriority

public void setPriority(double priority)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

NASA World Wind