formatting

This commit is contained in:
Hannes Janetzek 2013-02-04 20:14:58 +01:00
parent 303e0cb4ce
commit f2b7a9fdf8
72 changed files with 403 additions and 240 deletions

View File

@ -70,12 +70,14 @@ public class MapPosition {
// (float) (MercatorProjection.latitudeToPixelY(in.getLatitude(), zoomLevel) - y);
// }
/** @param geoPoint
/**
* @param geoPoint
* the map position.
* @param zoomLevel
* the zoom level.
* @param scale
* ... */
* ...
*/
public MapPosition(GeoPoint geoPoint, byte zoomLevel, float scale) {
this.zoomLevel = zoomLevel;
this.scale = scale;

View File

@ -49,6 +49,7 @@ public final class MercatorProjection {
/**
* Calculates the distance on the ground that is represented by a single
* pixel on the map.
*
* @param latitude
* the latitude coordinate at which the resolution should be
* calculated.
@ -64,6 +65,7 @@ public final class MercatorProjection {
/**
* Converts a latitude coordinate (in degrees) to a pixel Y coordinate at a
* certain zoom level.
*
* @param latitude
* the latitude coordinate that should be converted.
* @param zoomLevel
@ -84,6 +86,7 @@ public final class MercatorProjection {
/**
* Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
*
* @param latitude
* the latitude coordinate that should be converted.
* @return the position .
@ -96,6 +99,7 @@ public final class MercatorProjection {
/**
* Converts a latitude coordinate (in degrees) to a tile Y number at a
* certain zoom level.
*
* @param latitude
* the latitude coordinate that should be converted.
* @param zoomLevel
@ -138,6 +142,7 @@ public final class MercatorProjection {
/**
* Converts a longitude coordinate (in degrees) to a pixel X coordinate at a
* certain zoom level.
*
* @param longitude
* the longitude coordinate that should be converted.
* @param zoomLevel
@ -155,6 +160,7 @@ public final class MercatorProjection {
/**
* Projects a longitude coordinate (in degrees) to the range [0.0,1.0]
*
* @param longitude
* the longitude coordinate that should be converted.
* @return the position .
@ -166,6 +172,7 @@ public final class MercatorProjection {
/**
* Converts a longitude coordinate (in degrees) to the tile X number at a
* certain zoom level.
*
* @param longitude
* the longitude coordinate that should be converted.
* @param zoomLevel
@ -179,6 +186,7 @@ public final class MercatorProjection {
/**
* Converts a pixel X coordinate at a certain zoom level to a longitude
* coordinate.
*
* @param pixelX
* the pixel X coordinate that should be converted.
* @param zoomLevel
@ -191,6 +199,7 @@ public final class MercatorProjection {
/**
* Converts a pixel X coordinate to the tile X number.
*
* @param pixelX
* the pixel X coordinate that should be converted.
* @param zoomLevel
@ -205,6 +214,7 @@ public final class MercatorProjection {
/**
* Converts a pixel Y coordinate at a certain zoom level to a latitude
* coordinate.
*
* @param pixelY
* the pixel Y coordinate that should be converted.
* @param zoomLevel
@ -218,6 +228,7 @@ public final class MercatorProjection {
/**
* Converts a pixel Y coordinate to the tile Y number.
*
* @param pixelY
* the pixel Y coordinate that should be converted.
* @param zoomLevel
@ -232,6 +243,7 @@ public final class MercatorProjection {
/**
* Converts a tile X number at a certain zoom level to a longitude
* coordinate.
*
* @param tileX
* the tile X number that should be converted.
* @param zoomLevel
@ -245,6 +257,7 @@ public final class MercatorProjection {
/**
* Converts a tile Y number at a certain zoom level to a latitude
* coordinate.
*
* @param tileY
* the tile Y number that should be converted.
* @param zoomLevel

View File

@ -25,6 +25,7 @@ public interface IMapDatabase {
/**
* Starts a database query with the given parameters.
*
* @param tile
* the tile to read.
* @param mapDatabaseCallback
@ -48,6 +49,7 @@ public interface IMapDatabase {
/**
* Opens MapDatabase
*
* @param options
* the options.
* @return a OpenResult containing an error message in case of a failure.

View File

@ -19,6 +19,9 @@ import org.oscim.database.mapfile.MapDatabase;
/**
* Callback methods which can be triggered from the {@link MapDatabase}.
* ____
* NOTE: All parameters passed belong to the caller! i.e. dont hold
* references to any arrays after callback function returns.
*/
public interface IMapDatabaseCallback {
/**
@ -44,15 +47,16 @@ public interface IMapDatabaseCallback {
* Renders a single way or area (closed way).
*
* @param layer
* the layer of the way.
* the osm layer of the way.
* @param tags
* the tags of the way.
* @param wayNodes
* the geographical coordinates of the way nodes in the order longitude/latitude.
* the geographical coordinates of the way nodes in the order
* longitude/latitude or x/y depending on the projection.
* @param wayLength
* length of way data in wayNodes
* @param closed
* way is closed (means need to add endpoint == startpoint)
* wheter the way is an polygon.
* @param prio TODO
*/
void renderWay(byte layer, Tag[] tags, float[] wayNodes, short[] wayLength,
@ -65,7 +69,8 @@ public interface IMapDatabaseCallback {
* ...
* @param closed
* ...
* @return true if the way will be rendered (i.e. found match in RenderTheme)
* @return true if the way will be rendered (i.e. found match in
* RenderTheme)
*/
boolean checkWay(Tag[] tags, boolean closed);

View File

@ -25,7 +25,8 @@ public final class MapDatabaseFactory {
/**
* @param attributeSet
* A collection of attributes which includes the desired MapDatabase.
* A collection of attributes which includes the desired
* MapDatabase.
* @return a new MapDatabase instance.
*/
public static IMapDatabase createMapDatabase(AttributeSet attributeSet) {

View File

@ -80,7 +80,8 @@ public class MapInfo {
public final Byte startZoomLevel;
/**
* Zoomlevels provided by this Database, if null then any zoomlevel can be queried.
* Zoomlevels provided by this Database, if null then any zoomlevel can be
* queried.
*/
public final int[] zoomLevel;

View File

@ -14,9 +14,9 @@
*/
package org.oscim.database;
/**
* A FileOpenResult is a simple DTO which is returned by IMapDatabase#openFile(File).
* A FileOpenResult is a simple DTO which is returned by
* IMapDatabase#openFile(File).
*/
public class OpenResult {
/**

View File

@ -30,7 +30,8 @@ final class Deserializer {
* @return the long value.
*/
static long getFiveBytesLong(byte[] buffer, int offset) {
return (buffer[offset] & 0xffL) << 32 | (buffer[offset + 1] & 0xffL) << 24 | (buffer[offset + 2] & 0xffL) << 16
return (buffer[offset] & 0xffL) << 32 | (buffer[offset + 1] & 0xffL) << 24
| (buffer[offset + 2] & 0xffL) << 16
| (buffer[offset + 3] & 0xffL) << 8 | (buffer[offset + 4] & 0xffL);
}
@ -46,7 +47,8 @@ final class Deserializer {
* @return the int value.
*/
static int getInt(byte[] buffer, int offset) {
return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16 | (buffer[offset + 2] & 0xff) << 8
return buffer[offset] << 24 | (buffer[offset + 1] & 0xff) << 16
| (buffer[offset + 2] & 0xff) << 8
| (buffer[offset + 3] & 0xff);
}
@ -62,9 +64,11 @@ final class Deserializer {
* @return the long value.
*/
static long getLong(byte[] buffer, int offset) {
return (buffer[offset] & 0xffL) << 56 | (buffer[offset + 1] & 0xffL) << 48 | (buffer[offset + 2] & 0xffL) << 40
return (buffer[offset] & 0xffL) << 56 | (buffer[offset + 1] & 0xffL) << 48
| (buffer[offset + 2] & 0xffL) << 40
| (buffer[offset + 3] & 0xffL) << 32 | (buffer[offset + 4] & 0xffL) << 24
| (buffer[offset + 5] & 0xffL) << 16 | (buffer[offset + 6] & 0xffL) << 8 | (buffer[offset + 7] & 0xffL);
| (buffer[offset + 5] & 0xffL) << 16 | (buffer[offset + 6] & 0xffL) << 8
| (buffer[offset + 7] & 0xffL);
}
/**

View File

@ -37,7 +37,8 @@ class IndexCache {
/**
* Maximum size in bytes of one index block.
*/
private static final int SIZE_OF_INDEX_BLOCK = INDEX_ENTRIES_PER_BLOCK * SubFileParameter.BYTES_PER_INDEX_ENTRY;
private static final int SIZE_OF_INDEX_BLOCK = INDEX_ENTRIES_PER_BLOCK
* SubFileParameter.BYTES_PER_INDEX_ENTRY;
private final Map<IndexCacheEntryKey, byte[]> map;
private final RandomAccessFile randomAccessFile;
@ -63,11 +64,13 @@ class IndexCache {
}
/**
* Returns the index entry of a block in the given map file. If the required index entry is not cached, it will be
* Returns the index entry of a block in the given map file. If the required
* index entry is not cached, it will be
* read from the map file index and put in the cache.
*
* @param subFileParameter
* the parameters of the map file for which the index entry is needed.
* the parameters of the map file for which the index entry is
* needed.
* @param blockNumber
* the number of the block in the map file.
* @return the index entry or -1 if the block number is invalid.
@ -83,13 +86,15 @@ class IndexCache {
long indexBlockNumber = blockNumber / INDEX_ENTRIES_PER_BLOCK;
// create the cache entry key for this request
IndexCacheEntryKey indexCacheEntryKey = new IndexCacheEntryKey(subFileParameter, indexBlockNumber);
IndexCacheEntryKey indexCacheEntryKey = new IndexCacheEntryKey(subFileParameter,
indexBlockNumber);
// check for cached index block
byte[] indexBlock = this.map.get(indexCacheEntryKey);
if (indexBlock == null) {
// cache miss, seek to the correct index block in the file and read it
long indexBlockPosition = subFileParameter.indexStartAddress + indexBlockNumber * SIZE_OF_INDEX_BLOCK;
long indexBlockPosition = subFileParameter.indexStartAddress + indexBlockNumber
* SIZE_OF_INDEX_BLOCK;
int remainingIndexSize = (int) (subFileParameter.indexEndAddress - indexBlockPosition);
int indexBlockSize = Math.min(SIZE_OF_INDEX_BLOCK, remainingIndexSize);

View File

@ -48,7 +48,8 @@ class IndexCacheEntryKey {
IndexCacheEntryKey other = (IndexCacheEntryKey) obj;
if (this.subFileParameter == null && other.subFileParameter != null) {
return false;
} else if (this.subFileParameter != null && !this.subFileParameter.equals(other.subFileParameter)) {
} else if (this.subFileParameter != null
&& !this.subFileParameter.equals(other.subFileParameter)) {
return false;
} else if (this.indexBlockNumber != other.indexBlockNumber) {
return false;
@ -66,7 +67,8 @@ class IndexCacheEntryKey {
*/
private int calculateHashCode() {
int result = 7;
result = 31 * result + ((this.subFileParameter == null) ? 0 : this.subFileParameter.hashCode());
result = 31 * result
+ ((this.subFileParameter == null) ? 0 : this.subFileParameter.hashCode());
result = 31 * result + (int) (this.indexBlockNumber ^ (this.indexBlockNumber >>> 32));
return result;
}

View File

@ -51,8 +51,10 @@ public class ReadBuffer {
}
/**
* Reads the given amount of bytes from the file into the read buffer and resets the internal buffer position. If
* the capacity of the read buffer is too small, a larger one is created automatically.
* Reads the given amount of bytes from the file into the read buffer and
* resets the internal buffer position. If
* the capacity of the read buffer is too small, a larger one is created
* automatically.
*
* @param length
* the amount of bytes to read from the file.
@ -134,8 +136,9 @@ public class ReadBuffer {
/**
* Converts a variable amount of bytes from the read buffer to a signed int.
* <p>
* The first bit is for continuation info, the other six (last byte) or seven (all other bytes) bits are for data.
* The second bit in the last byte indicates the sign of the number.
* The first bit is for continuation info, the other six (last byte) or
* seven (all other bytes) bits are for data. The second bit in the last
* byte indicates the sign of the number.
*
* @return the value.
*/
@ -192,10 +195,12 @@ public class ReadBuffer {
}
/**
* Converts a variable amount of bytes from the read buffer to a signed int array.
* Converts a variable amount of bytes from the read buffer to a signed int
* array.
* <p>
* The first bit is for continuation info, the other six (last byte) or seven (all other bytes) bits are for data.
* The second bit in the last byte indicates the sign of the number.
* The first bit is for continuation info, the other six (last byte) or
* seven (all other bytes) bits are for data. The second bit in the last
* byte indicates the sign of the number.
*
* @param values
* result values
@ -322,9 +327,11 @@ public class ReadBuffer {
// }
/**
* Converts a variable amount of bytes from the read buffer to an unsigned int.
* Converts a variable amount of bytes from the read buffer to an unsigned
* int.
* <p>
* The first bit is for continuation info, the other seven bits are for data.
* The first bit is for continuation info, the other seven bits are for
* data.
*
* @return the int value.
*/
@ -396,7 +403,8 @@ public class ReadBuffer {
if (stringLength > 0 && mBufferPosition + stringLength <= mBufferData.length) {
mBufferPosition += stringLength;
try {
return new String(mBufferData, mBufferPosition - stringLength, stringLength, CHARSET_UTF8);
return new String(mBufferData, mBufferPosition - stringLength, stringLength,
CHARSET_UTF8);
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}

View File

@ -59,7 +59,8 @@ final class OptionalFields {
*/
private static final int START_ZOOM_LEVEL_MAX = 22;
static OpenResult readOptionalFields(ReadBuffer readBuffer, MapFileInfoBuilder mapFileInfoBuilder) {
static OpenResult readOptionalFields(ReadBuffer readBuffer,
MapFileInfoBuilder mapFileInfoBuilder) {
OptionalFields optionalFields = new OptionalFields(readBuffer.readByte());
mapFileInfoBuilder.optionalFields = optionalFields;
@ -106,13 +107,15 @@ final class OptionalFields {
if (this.hasStartPosition) {
// get and check the start position latitude (4 byte)
int mapStartLatitude = readBuffer.readInt();
if (mapStartLatitude < RequiredFields.LATITUDE_MIN || mapStartLatitude > RequiredFields.LATITUDE_MAX) {
if (mapStartLatitude < RequiredFields.LATITUDE_MIN
|| mapStartLatitude > RequiredFields.LATITUDE_MAX) {
return new OpenResult("invalid map start latitude: " + mapStartLatitude);
}
// get and check the start position longitude (4 byte)
int mapStartLongitude = readBuffer.readInt();
if (mapStartLongitude < RequiredFields.LONGITUDE_MIN || mapStartLongitude > RequiredFields.LONGITUDE_MAX) {
if (mapStartLongitude < RequiredFields.LONGITUDE_MIN
|| mapStartLongitude > RequiredFields.LONGITUDE_MAX) {
return new OpenResult("invalid map start longitude: " + mapStartLongitude);
}

View File

@ -104,11 +104,13 @@ final class RequiredFields {
return new OpenResult("invalid longitude range: " + minLongitude + SPACE + maxLongitude);
}
mapFileInfoBuilder.boundingBox = new BoundingBox(minLatitude, minLongitude, maxLatitude, maxLongitude);
mapFileInfoBuilder.boundingBox = new BoundingBox(minLatitude, minLongitude, maxLatitude,
maxLongitude);
return OpenResult.SUCCESS;
}
static OpenResult readFileSize(ReadBuffer readBuffer, long fileSize, MapFileInfoBuilder mapFileInfoBuilder) {
static OpenResult readFileSize(ReadBuffer readBuffer, long fileSize,
MapFileInfoBuilder mapFileInfoBuilder) {
// get and check the file size (8 bytes)
long headerFileSize = readBuffer.readLong();
if (headerFileSize != fileSize) {
@ -174,7 +176,8 @@ final class RequiredFields {
return OpenResult.SUCCESS;
}
static OpenResult readProjectionName(ReadBuffer readBuffer, MapFileInfoBuilder mapFileInfoBuilder) {
static OpenResult readProjectionName(ReadBuffer readBuffer,
MapFileInfoBuilder mapFileInfoBuilder) {
// get and check the projection name
String projectionName = readBuffer.readUTF8EncodedString();
if (!MERCATOR.equals(projectionName)) {

View File

@ -120,14 +120,18 @@ public class SubFileParameter {
this.hashCodeValue = calculateHashCode();
// calculate the XY numbers of the boundary tiles in this sub-file
this.boundaryTileBottom = MercatorProjection.latitudeToTileY(subFileParameterBuilder.boundingBox.minLatitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileLeft = MercatorProjection.longitudeToTileX(subFileParameterBuilder.boundingBox.minLongitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileTop = MercatorProjection.latitudeToTileY(subFileParameterBuilder.boundingBox.maxLatitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileRight = MercatorProjection.longitudeToTileX(subFileParameterBuilder.boundingBox.maxLongitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileBottom = MercatorProjection.latitudeToTileY(
subFileParameterBuilder.boundingBox.minLatitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileLeft = MercatorProjection.longitudeToTileX(
subFileParameterBuilder.boundingBox.minLongitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileTop = MercatorProjection.latitudeToTileY(
subFileParameterBuilder.boundingBox.maxLatitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
this.boundaryTileRight = MercatorProjection.longitudeToTileX(
subFileParameterBuilder.boundingBox.maxLongitudeE6
/ COORDINATES_DIVISOR, this.baseZoomLevel);
// calculate the horizontal and vertical amount of blocks in this sub-file
this.blocksWidth = this.boundaryTileRight - this.boundaryTileLeft + 1;

View File

@ -1239,8 +1239,10 @@ public class MapDatabase implements IMapDatabase {
mCacheFile = null;
}
/* All code below is taken from or based on Google's Protocol Buffers
* implementation: */
/*
* All code below is taken from or based on Google's Protocol Buffers
* implementation:
*/
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.

View File

@ -107,7 +107,8 @@ abstract class Geometry implements Serializable {
boolean haveMeasure = false;
/**
* The OGIS geometry type of this feature. this is final as it never changes, it is bound to the subclass of the
* The OGIS geometry type of this feature. this is final as it never
* changes, it is bound to the subclass of the
* instance.
*/
final int type;
@ -165,7 +166,8 @@ abstract class Geometry implements Serializable {
}
/**
* geometry specific equals implementation - only defined for non-null values
* geometry specific equals implementation - only defined for non-null
* values
*
* @param other
* ...
@ -180,7 +182,8 @@ abstract class Geometry implements Serializable {
}
/**
* Whether test coordinates for geometry - subclass specific code Implementors can assume that dimensin, type, srid
* Whether test coordinates for geometry - subclass specific code
* Implementors can assume that dimensin, type, srid
* and haveMeasure are equal, other != null and other is the same subclass.
*
* @param other
@ -245,7 +248,8 @@ abstract class Geometry implements Serializable {
}
/**
* Queries the number of geometric dimensions of this geometry. This does not include measures, as opposed to the
* Queries the number of geometric dimensions of this geometry. This does
* not include measures, as opposed to the
* server.
*
* @return The dimensionality (eg, 2D or 3D) of this geometry.
@ -264,7 +268,8 @@ abstract class Geometry implements Serializable {
}
/**
* Recursively sets the srid on this geometry and all contained subgeometries
* Recursively sets the srid on this geometry and all contained
* subgeometries
*
* @param srid
* ...
@ -286,7 +291,8 @@ abstract class Geometry implements Serializable {
}
/**
* Render the WKT version of this Geometry (without SRID) into the given StringBuffer.
* Render the WKT version of this Geometry (without SRID) into the given
* StringBuffer.
*
* @param sb
* ...
@ -306,7 +312,8 @@ abstract class Geometry implements Serializable {
}
/**
* Render the WKT without the type name, but including the brackets into the StringBuffer
* Render the WKT without the type name, but including the brackets into the
* StringBuffer
*
* @param sb
* ...
@ -318,7 +325,8 @@ abstract class Geometry implements Serializable {
}
/**
* Render the "inner" part of the WKT (inside the brackets) into the StringBuffer.
* Render the "inner" part of the WKT (inside the brackets) into the
* StringBuffer.
*
* @param SB
* ...
@ -337,10 +345,14 @@ abstract class Geometry implements Serializable {
}
/**
* Do some internal consistency checks on the geometry. Currently, all Geometries must have a valid dimension (2 or
* 3) and a valid type. 2-dimensional Points must have Z=0.0, as well as non-measured Points must have m=0.0.
* Composed geometries must have all equal SRID, dimensionality and measures, as well as that they do not contain
* NULL or inconsistent subgeometries. BinaryParser and WKTParser should only generate consistent geometries.
* Do some internal consistency checks on the geometry. Currently, all
* Geometries must have a valid dimension (2 or
* 3) and a valid type. 2-dimensional Points must have Z=0.0, as well as
* non-measured Points must have m=0.0.
* Composed geometries must have all equal SRID, dimensionality and
* measures, as well as that they do not contain
* NULL or inconsistent subgeometries. BinaryParser and WKTParser should
* only generate consistent geometries.
* BinaryWriter may produce invalid results on inconsistent geometries.
*
* @return true if all checks are passed.

View File

@ -248,7 +248,8 @@ public class MapDatabase implements IMapDatabase {
}
/**
* Parse a binary encoded geometry. Is synchronized to protect offset counter. (Unfortunately, Java does not have
* Parse a binary encoded geometry. Is synchronized to protect offset
* counter. (Unfortunately, Java does not have
* neither call by reference nor multiple return values.)
*
* @param value

View File

@ -66,7 +66,8 @@ abstract class ValueGetter {
protected abstract int getInt(int index);
/**
* Get a long value. This is not needed directly, but as a nice side-effect from GetDouble.
* Get a long value. This is not needed directly, but as a nice side-effect
* from GetDouble.
*
* @param index
* ...
@ -101,9 +102,12 @@ abstract class ValueGetter {
protected long getLong(int index) {
return ((long) (data[index] & 0xFF) << 56) | ((long) (data[index + 1] & 0xFF) << 48)
| ((long) (data[index + 2] & 0xFF) << 40) | ((long) (data[index + 3] & 0xFF) << 32)
| ((long) (data[index + 4] & 0xFF) << 24) | ((long) (data[index + 5] & 0xFF) << 16)
| ((long) (data[index + 6] & 0xFF) << 8) | ((long) (data[index + 7] & 0xFF) << 0);
| ((long) (data[index + 2] & 0xFF) << 40)
| ((long) (data[index + 3] & 0xFF) << 32)
| ((long) (data[index + 4] & 0xFF) << 24)
| ((long) (data[index + 5] & 0xFF) << 16)
| ((long) (data[index + 6] & 0xFF) << 8)
| ((long) (data[index + 7] & 0xFF) << 0);
}
}
@ -122,9 +126,12 @@ abstract class ValueGetter {
@Override
protected long getLong(int index) {
return ((long) (data[index + 7] & 0xFF) << 56) | ((long) (data[index + 6] & 0xFF) << 48)
| ((long) (data[index + 5] & 0xFF) << 40) | ((long) (data[index + 4] & 0xFF) << 32)
| ((long) (data[index + 3] & 0xFF) << 24) | ((long) (data[index + 2] & 0xFF) << 16)
return ((long) (data[index + 7] & 0xFF) << 56)
| ((long) (data[index + 6] & 0xFF) << 48)
| ((long) (data[index + 5] & 0xFF) << 40)
| ((long) (data[index + 4] & 0xFF) << 32)
| ((long) (data[index + 3] & 0xFF) << 24)
| ((long) (data[index + 2] & 0xFF) << 16)
| ((long) (data[index + 1] & 0xFF) << 8) | ((long) (data[index] & 0xFF) << 0);
}

View File

@ -14,7 +14,6 @@
*/
package org.oscim.database.test;
import org.oscim.core.BoundingBox;
import org.oscim.core.Tag;
import org.oscim.core.Tile;

View File

@ -210,6 +210,7 @@ public class TileGenerator implements IRenderCallback, IMapDatabaseCallback {
/**
* Sets the scale stroke factor for the given zoom level.
*
* @param zoomLevel
* the zoom level for which the scale stroke factor should be
* set.

View File

@ -33,6 +33,7 @@ public class DefaultResourceProxyImpl implements ResourceProxy, MapViewConstants
/**
* Constructor.
*
* @param pContext
* Used to get the display metrics that are used for scaling the
* bitmaps returned by {@@link getBitmap}. Can be null,

View File

@ -188,6 +188,7 @@ public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverl
* When a content sensitive action is performed the content item needs to be
* identified. This method does that and then performs the assigned task on
* that item.
*
* @param event
* ...
* @param mapView
@ -256,6 +257,7 @@ public class ItemizedIconOverlay<Item extends OverlayItem> extends ItemizedOverl
* When the item is touched one of these methods may be invoked depending on
* the type of touch. Each of them returns true if the event was completely
* handled.
*
* @param <T>
* ....
*/

View File

@ -39,6 +39,7 @@ import android.opengl.Matrix;
* lowest index is drawn as last and therefore the 'topmost' marker. It also
* gets checked for onTap first. This class is generic, because you then you get
* your custom item-class passed back in onTap().
*
* @param <Item>
* ...
*/
@ -220,6 +221,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/**
* Method by which subclasses create the actual Items. This will only be
* called from populate() we'll cache them for later use.
*
* @param i
* ...
* @return ...
@ -228,6 +230,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/**
* The number of items in this overlay.
*
* @return ...
*/
public abstract int size();
@ -293,6 +296,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/**
* Returns the Item at the given index.
*
* @param position
* the position of the item to return
* @return the Item of the given index.
@ -321,6 +325,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
* Override to modify the way an item is hit tested. The hit point is
* relative to the marker's bounds. The default implementation just checks
* to see if the hit point is within the touchable bounds of the marker.
*
* @param item
* the item to hit test
* @param marker
@ -340,6 +345,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
/**
* Set whether or not to draw the focused item. The default is to draw it,
* but some clients may prefer to draw the focused item themselves.
*
* @param drawFocusedItem
* ...
*/
@ -354,6 +360,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
* move the map, so if the Item isn't already centered, the user may get
* confused. If the Item is not found, this is a no-op. You can also pass
* null to remove focus.
*
* @param item
* ...
*/
@ -373,6 +380,7 @@ public abstract class ItemizedOverlay<Item extends OverlayItem> extends Overlay
* Adjusts a drawable's bounds so that (0,0) is a pixel in the location
* described by the hotspot parameter. Useful for "pin"-like graphics. For
* convenience, returns the same drawable that was passed in.
*
* @param marker
* the drawable to adjust
* @param hotspot

View File

@ -19,6 +19,7 @@ package org.oscim.overlay;
/**
* This class contains constants used by the map view.
*
* @author Nicolas Gramlich
*/
public interface MapViewConstants {

View File

@ -36,6 +36,7 @@ import android.view.MotionEvent;
* {@link android.view.GestureDetector.SimpleOnGestureListener} and
* GestureDetector.OnGestureListener. The difference is there is an additional
* argument for the item.
*
* @author Nicolas Gramlich
*/
public abstract class Overlay implements OverlayConstants {
@ -94,6 +95,7 @@ public abstract class Overlay implements OverlayConstants {
/**
* Sets whether the Overlay is marked to be enabled. This setting does
* nothing by default, but should be checked before calling draw().
*
* @param pEnabled
* ...
*/
@ -104,6 +106,7 @@ public abstract class Overlay implements OverlayConstants {
/**
* Specifies if the Overlay is marked to be enabled. This should be checked
* before calling draw().
*
* @return true if the Overlay is marked enabled, false otherwise
*/
public boolean isEnabled() {
@ -115,6 +118,7 @@ public abstract class Overlay implements OverlayConstants {
* IDs cannot be fixed at compile time. Overlays should use this method to
* obtain and store a menu id for each menu item at construction time. This
* will ensure that two overlays don't use the same id.
*
* @return an integer suitable to be used as a menu identifier
*/
protected final static int getSafeMenuId() {
@ -125,6 +129,7 @@ public abstract class Overlay implements OverlayConstants {
* Similar to <see cref="getSafeMenuId" />, except this reserves a sequence
* of IDs of length <param name="count" />. The returned number is the
* starting index of that sequential list.
*
* @param count
* ....
* @return an integer suitable to be used as a menu identifier
@ -159,6 +164,7 @@ public abstract class Overlay implements OverlayConstants {
/**
* Override to perform clean up of resources before shutdown. By default
* does nothing.
*
* @param mapView
* ...
*/
@ -170,6 +176,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param keyCode
* ...
* @param event
@ -187,6 +194,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param keyCode
* ...
* @param event
@ -205,6 +213,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -220,6 +229,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -237,6 +247,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -252,6 +263,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -267,6 +279,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -284,6 +297,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -299,6 +313,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param pEvent1
* ...
* @param pEvent2
@ -321,6 +336,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -336,6 +352,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param pEvent1
* ...
* @param pEvent2
@ -368,6 +385,7 @@ public abstract class Overlay implements OverlayConstants {
* Event, return <code>true</code>, otherwise return <code>false</code>. If
* you returned <code>true</code> none of the following Overlays or the
* underlying {@link MapView} has the chance to handle this event.
*
* @param e
* ...
* @param mapView
@ -428,6 +446,7 @@ public abstract class Overlay implements OverlayConstants {
/**
* Checks to see if the given x and y are close enough to an item
* resulting in snapping the current action (e.g. zoom) to the item.
*
* @param x
* The x in screen coordinates.
* @param y

View File

@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable;
/**
* Immutable class describing a GeoPoint with a Title and a Description.
*
* @author Nicolas Gramlich
* @author Theodore Hong
* @author Fred Eisele
@ -102,7 +103,8 @@ public class OverlayItem {
return mGeoPoint;
}
/* (copied from Google API docs) Returns the marker that should be used when
/*
* (copied from Google API docs) Returns the marker that should be used when
* drawing this item on the map. A null value means that the default marker
* should be drawn. Different markers can be returned for different states.
* The different markers can have different bounds. The default behavior is
@ -110,7 +112,8 @@ public class OverlayItem {
* overlay item's marker, if it exists, and then return it.
* @param stateBitset The current state.
* @return The marker for the current state, or null if the default marker
* for the overlay should be used. */
* for the overlay should be used.
*/
public Drawable getMarker(final int stateBitset) {
// marker not specified
if (mMarker == null) {
@ -141,12 +144,14 @@ public class OverlayItem {
// ===========================================================
// Methods
// ===========================================================
/* (copied from the Google API docs) Sets the state of a drawable to match a
/*
* (copied from the Google API docs) Sets the state of a drawable to match a
* given state bitset. This is done by converting the state bitset bits
* into
* a state set of R.attr.state_pressed, R.attr.state_selected and
* R.attr.state_focused attributes, and then calling {@link
* Drawable.setState(int[])}. */
* Drawable.setState(int[])}.
*/
public static void setState(final Drawable drawable, final int stateBitset) {
final int[] states = new int[3];
int index = 0;

View File

@ -192,6 +192,7 @@ public class PathOverlay extends Overlay {
/**
* Draw a great circle. Calculate a point for every 100km along the path.
*
* @param startPoint
* start point of the great circle
* @param endPoint
@ -212,6 +213,7 @@ public class PathOverlay extends Overlay {
/**
* Draw a great circle.
*
* @param startPoint
* start point of the great circle
* @param endPoint

View File

@ -53,6 +53,7 @@ public interface ResourceProxy {
/**
* Use a string resource as a format definition, and format using the
* supplied format arguments.
*
* @param pResId
* ...
* @param formatArgs
@ -65,6 +66,7 @@ public interface ResourceProxy {
/**
* Get a bitmap as a {@link Drawable}
*
* @param pResId
* ...
* @return ...
@ -73,6 +75,7 @@ public interface ResourceProxy {
/**
* Gets the density from the current screen's DisplayMetrics
*
* @return the screen's density
*/
float getDisplayMetricsDensity();

View File

@ -146,6 +146,7 @@ public final class PolygonRenderer {
/**
* draw polygon layers (unil layer.next is not polygon layer)
* using stencil buffer method
*
* @param pos
* used to fade layers accorind to 'fade'
* in layer.area.
@ -234,6 +235,7 @@ public final class PolygonRenderer {
/**
* Draw a tile filling rectangle to set stencil- and depth buffer
* appropriately
*
* @param first in the first run the clip region is set based on
* depth buffer and depth buffer is updated
*/
@ -305,8 +307,10 @@ public final class PolygonRenderer {
glUniformMatrix4fv(hPolygonMatrix, 1, false, matrix, 0);
}
/* clear stencilbuffer (tile region) by drawing
* a quad with func 'always' and op 'zero' */
/*
* clear stencilbuffer (tile region) by drawing
* a quad with func 'always' and op 'zero'
*/
// disable drawing to framebuffer (will be re-enabled in fill)
glColorMask(false, false, false, false);

View File

@ -160,8 +160,10 @@ public abstract class ScanBox {
}
}
/* ported from Polymaps: Layer.js Copyright (c) 2010, SimpleGeo and Stamen
* Design */
/*
* ported from Polymaps: Layer.js Copyright (c) 2010, SimpleGeo and Stamen
* Design
*/
// // scan-line conversion
// function edge(a, b) {

View File

@ -152,6 +152,7 @@ public class TileManager {
* Update list of visible tiles and passes them to TileManager, when not
* available tiles are created and added to JobQueue (mapView.addJobs) for
* loading by TileGenerator class
*
* @param clear
* whether to clear and reload all tiles
*/
@ -292,6 +293,7 @@ public class TileManager {
/**
* set mNewTiles for the visible tiles and pass it to GLRenderer, add jobs
* for not yet loaded tiles
*
* @param mapPosition
* the current MapPosition
* @param zdir
@ -556,6 +558,7 @@ public class TileManager {
/**
* called from MapWorker Thread when tile is loaded by TileGenerator
*
* @param jobTile
* Tile ready for upload to GL
* @return ... caller does not care

View File

@ -57,6 +57,7 @@ public final class LineLayer extends Layer {
/**
* line extrusion is based on code from GLMap
* (https://github.com/olofsj/GLMap/)
*
* @param points
* array of points as x,y pairs
* @param index

View File

@ -45,6 +45,7 @@ public abstract class RenderOverlay {
* called 1. by GLRenderer. Set 'newData' true when 'compile()' should be
* called
* before next 'render()'
*
* @param curPos TODO
* @param positionChanged
* true when MapPosition has changed
@ -61,6 +62,7 @@ public abstract class RenderOverlay {
/**
* called 3. draw overlay
*
* @param pos
* current MapPosition
* @param mv
@ -73,6 +75,7 @@ public abstract class RenderOverlay {
/**
* Utility: set matrix relative to the difference of current MapPosition
* and the last updated Overlay MapPosition
*
* @param curPos ...
* @param matrix ...
*/
@ -106,6 +109,7 @@ public abstract class RenderOverlay {
/**
* Utility: update mMapPosition
*
* @return true if position has changed
*/
protected boolean updateMapPosition() {

View File

@ -21,9 +21,9 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
/**
* An ExternalRenderTheme allows for customizing the rendering style of the map via an XML file.
* An ExternalRenderTheme allows for customizing the rendering style of the map
* via an XML file.
*/
public class ExternalRenderTheme implements Theme {
private static final long serialVersionUID = 1L;
@ -101,7 +101,8 @@ public class ExternalRenderTheme implements Theme {
mHashCodeValue = calculateHashCode();
}
private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException {
private void readObject(ObjectInputStream objectInputStream) throws IOException,
ClassNotFoundException {
objectInputStream.defaultReadObject();
calculateTransientValues();
}

View File

@ -276,6 +276,7 @@ public class RenderTheme {
/**
* Matches a way with the given parameters against this RenderTheme.
*
* @param renderCallback
* the callback implementation which will be executed on each
* match.
@ -442,6 +443,7 @@ public class RenderTheme {
/**
* Scales the stroke width of this RenderTheme by the given factor.
*
* @param scaleFactor
* the factor by which the stroke width should be scaled.
*/
@ -453,6 +455,7 @@ public class RenderTheme {
/**
* Scales the text size of this RenderTheme by the given factor.
*
* @param scaleFactor
* the factor by which the text size should be scaled.
*/

View File

@ -21,7 +21,8 @@ enum FontFamily {
/**
* @return the typeface object of this FontFamily.
* @see <a href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a>
* @see <a
* href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a>
*/
Typeface toTypeface() {
switch (this) {

View File

@ -19,7 +19,8 @@ enum FontStyle {
/**
* @return the constant int value of this FontStyle.
* @see <a href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a>
* @see <a
* href="http://developer.android.com/reference/android/graphics/Typeface.html">Typeface</a>
*/
int toInt() {
switch (this) {

View File

@ -27,7 +27,8 @@ public final class AndroidUtils {
private static final String[] EMULATOR_NAMES = { "google_sdk", "sdk" };
/**
* @return true if the application is running on the Android emulator, false otherwise.
* @return true if the application is running on the Android emulator, false
* otherwise.
*/
public static boolean applicationRunsOnAndroidEmulator() {
for (int i = 0, n = EMULATOR_NAMES.length; i < n; ++i) {

View File

@ -23,6 +23,7 @@ public final class GeometryUtils {
/**
* Calculates the center of the minimum bounding rectangle for the given
* coordinates.
*
* @param coordinates
* the coordinates for which calculation should be done.
* @return the center coordinates of the minimum bounding rectangle.

View File

@ -126,7 +126,8 @@ public class GlConfigChooser implements GLSurfaceView.EGLConfigChooser {
int s = findConfigAttrib(egl, display, config, EGL10.EGL_STENCIL_SIZE, 0);
/*
* EGL_CONFIG_CAVEAT value #define EGL_NONE 0x3038 #define EGL_SLOW_CONFIG 0x3050 #define
* EGL_CONFIG_CAVEAT value #define EGL_NONE 0x3038 #define
* EGL_SLOW_CONFIG 0x3050 #define
* EGL_NON_CONFORMANT_CONFIG 0x3051
*/

View File

@ -18,8 +18,10 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
* An LRUCache with a fixed size and an access-order policy. Old mappings are automatically removed from the cache when
* new mappings are added. This implementation uses an {@link LinkedHashMap} internally.
* An LRUCache with a fixed size and an access-order policy. Old mappings are
* automatically removed from the cache when
* new mappings are added. This implementation uses an {@link LinkedHashMap}
* internally.
*
* @param <K>
* the type of the map key, see {@link Map}.

View File

@ -111,7 +111,8 @@ public abstract class PausableThread extends Thread {
}
/**
* Called once when this thread continues to work after a pause. The default implementation is empty.
* Called once when this thread continues to work after a pause. The default
* implementation is empty.
*/
protected void afterPause() {
// do nothing
@ -122,7 +123,8 @@ public abstract class PausableThread extends Thread {
}
/**
* Called once at the end of the {@link #run()} method. The default implementation is empty.
* Called once at the end of the {@link #run()} method. The default
* implementation is empty.
*/
protected void afterRun() {
// do nothing
@ -142,7 +144,8 @@ public abstract class PausableThread extends Thread {
protected abstract String getThreadName();
/**
* @return the priority of this thread. The default value is {@link Thread#NORM_PRIORITY}.
* @return the priority of this thread. The default value is
* {@link Thread#NORM_PRIORITY}.
*/
protected int getThreadPriority() {
return Thread.NORM_PRIORITY;

View File

@ -100,6 +100,7 @@ public abstract class MapActivity extends Activity {
/**
* This method is called once by each MapView during its setup process.
*
* @param mapView
* the calling MapView.
*/

View File

@ -27,7 +27,8 @@ import android.graphics.Paint;
import android.graphics.Typeface;
/**
* A MapScaleBar displays the ratio of a distance on the map to the corresponding distance on the ground.
* A MapScaleBar displays the ratio of a distance on the map to the
* corresponding distance on the ground.
*/
public class MapScaleBar {
/**
@ -128,7 +129,8 @@ public class MapScaleBar {
/**
* @param imperialUnits
* true if imperial units should be used rather than metric units.
* true if imperial units should be used rather than metric
* units.
*/
public void setImperialUnits(boolean imperialUnits) {
mImperialUnits = imperialUnits;

View File

@ -273,6 +273,7 @@ public class MapView extends RelativeLayout {
/**
* Calculates all necessary tiles and adds jobs accordingly.
*
* @param changedPos TODO
*/
public void redrawMap(boolean changedPos) {
@ -344,6 +345,7 @@ public class MapView extends RelativeLayout {
/**
* Sets the MapDatabase for this MapView.
*
* @param options
* the new MapDatabase options.
* @return ...
@ -395,6 +397,7 @@ public class MapView extends RelativeLayout {
/**
* Sets the internal theme which is used for rendering the map.
*
* @param internalRenderTheme
* the internal rendering theme.
* @return ...
@ -419,6 +422,7 @@ public class MapView extends RelativeLayout {
/**
* Sets the theme file which is used for rendering the map.
*
* @param renderThemePath
* the path to the XML file which defines the rendering theme.
* @throws IllegalArgumentException
@ -572,6 +576,7 @@ public class MapView extends RelativeLayout {
/**
* Sets the center and zoom level of this MapView and triggers a redraw.
*
* @param mapPosition
* the new map position of this MapView.
*/
@ -585,6 +590,7 @@ public class MapView extends RelativeLayout {
/**
* Sets the center of the MapView and triggers a redraw.
*
* @param geoPoint
* the new center point of the map.
*/
@ -604,6 +610,7 @@ public class MapView extends RelativeLayout {
/**
* add jobs and remember MapWorkers that stuff needs to be done
*
* @param jobs
* tile jobs
*/
@ -644,6 +651,7 @@ public class MapView extends RelativeLayout {
* You can add/remove/reorder your Overlays using the List of
* {@link Overlay}. The first (index 0) Overlay gets drawn first, the one
* with the highest as the last one.
*
* @return ...
*/
public List<Overlay> getOverlays() {

View File

@ -247,6 +247,7 @@ public class MapViewPosition {
/**
* ...
*
* @return BoundingBox containing view
*/
public synchronized BoundingBox getViewBox() {
@ -298,6 +299,7 @@ public class MapViewPosition {
/**
* for x,y in screen coordinates get the point on the map in map-tile
* coordinates
*
* @param x ...
* @param y ...
* @param reuse ...
@ -320,6 +322,7 @@ public class MapViewPosition {
/**
* get the GeoPoint for x,y in screen coordinates
*
* @param x screen pixel x
* @param y screen pixel y
* @return the corresponding GeoPoint
@ -344,6 +347,7 @@ public class MapViewPosition {
/**
* get the screen pixel for a GeoPoint
*
* @param geoPoint ...
* @param reuse ...
* @return ...
@ -456,6 +460,7 @@ public class MapViewPosition {
/**
* Moves this MapViewPosition by the given amount of pixels.
*
* @param mx the amount of pixels to move the map horizontally.
* @param my the amount of pixels to move the map vertically.
*/
@ -492,6 +497,7 @@ public class MapViewPosition {
/**
* -
*
* @param scale ...
* @param pivotX ...
* @param pivotY ...
@ -537,6 +543,7 @@ public class MapViewPosition {
/**
* rotate map around pivot cx,cy
*
* @param angle ...
* @param cx ...
* @param cy ...

View File

@ -52,6 +52,7 @@ public class TriangleJNI {
/**
* !!! NOT for general use!!! - this is specifically for ExtrusionLayer
* .
*
* @param points points to use: array of x,y coordinates
* @param numRings number of rings in polygon == outer(1) + inner rings
* @param io input: 1. number of all points, 2.. number of points in rings -