Package org.openstreetmap.josm.data
Class DataSource
- java.lang.Object
-
- org.openstreetmap.josm.data.DataSource
-
public class DataSource extends java.lang.Object
A data source, defined by bounds and textual description for the origin.- Since:
- 247 (creation), 7575 (moved package)
-
-
Constructor Summary
Constructors Constructor Description DataSource(Bounds bounds, java.lang.String origin)
Constructs a newDataSource
.DataSource(DataSource source)
Constructs a newDataSource
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static java.awt.geom.Area
getDataSourceArea(java.util.Collection<DataSource> dataSources)
Returns the total area of downloaded data (the "yellow rectangles").static java.util.List<Bounds>
getDataSourceBounds(java.util.Collection<DataSource> dataSources)
Replies the list of data source bounds.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
DataSource
public DataSource(Bounds bounds, java.lang.String origin)
Constructs a newDataSource
.- Parameters:
bounds
- The bounds of this data sourceorigin
- The textual description of the origin (example: "OpenStreetMap Server")- Throws:
java.lang.IllegalArgumentException
- if bounds isnull
-
DataSource
public DataSource(DataSource source)
Constructs a newDataSource
- Parameters:
source
- The source to copy the data from.- Since:
- 10346
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getDataSourceArea
public static java.awt.geom.Area getDataSourceArea(java.util.Collection<DataSource> dataSources)
Returns the total area of downloaded data (the "yellow rectangles").- Parameters:
dataSources
- list of data sources- Returns:
- Area object encompassing downloaded data.
- See Also:
Data.getDataSourceArea()
-
getDataSourceBounds
public static java.util.List<Bounds> getDataSourceBounds(java.util.Collection<DataSource> dataSources)
Replies the list of data source bounds.
Dataset maintains a list of data sources which have been merged into the data set. Each of these sources can optionally declare a bounding box of the data it supplied to the dataset.
This method replies the list of defined (non
null
) bounding boxes.- Parameters:
dataSources
- list of data sources- Returns:
- the list of data source bounds. An empty list, if no non-null data source bounds are defined.
- See Also:
Data.getDataSourceBounds()
-
-