Class PrimitiveTagTransferData
- java.lang.Object
-
- org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTagTransferData
-
- All Implemented Interfaces:
Serializable
public class PrimitiveTagTransferData extends Object implements Serializable
This is a variant ofTagTransferData
that holds tags that were copied from a collection of primitives.- Since:
- 10737
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private EnumMap<OsmPrimitiveType,Integer>
counts
static DataFlavor
FLAVOR
This is a data flavor addedprivate static long
serialVersionUID
private EnumMap<OsmPrimitiveType,TagCollection>
tags
-
Constructor Summary
Constructors Constructor Description PrimitiveTagTransferData(Collection<? extends PrimitiveData> source)
Create a newPrimitiveTagTransferData
PrimitiveTagTransferData(PrimitiveTransferData data)
Create a newPrimitiveTagTransferData
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TagCollection
getForPrimitives(OsmPrimitiveType type)
Gets the tags used for this primitive type.int
getSourcePrimitiveCount(OsmPrimitiveType type)
Gets the number of source primitives for the given type.Map<OsmPrimitiveType,Integer>
getStatistics()
Gets the statistics of the source primitive counts.boolean
isHeterogeneousSource()
Determines if the source for tag pasting is heterogeneous, i.e.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
FLAVOR
public static final DataFlavor FLAVOR
This is a data flavor added
-
tags
private final EnumMap<OsmPrimitiveType,TagCollection> tags
-
counts
private final EnumMap<OsmPrimitiveType,Integer> counts
-
-
Constructor Detail
-
PrimitiveTagTransferData
public PrimitiveTagTransferData(Collection<? extends PrimitiveData> source)
Create a newPrimitiveTagTransferData
- Parameters:
source
- The primitives to initialize this object with.
-
PrimitiveTagTransferData
public PrimitiveTagTransferData(PrimitiveTransferData data)
Create a newPrimitiveTagTransferData
- Parameters:
data
- The primitives to initialize this object with.
-
-
Method Detail
-
isHeterogeneousSource
public boolean isHeterogeneousSource()
Determines if the source for tag pasting is heterogeneous, i.e. if it doesn't consist ofOsmPrimitive
s of exactly one type- Returns:
- true if the source for tag pasting is heterogeneous
-
getForPrimitives
public TagCollection getForPrimitives(OsmPrimitiveType type)
Gets the tags used for this primitive type.- Parameters:
type
- The primitive type- Returns:
- The tags as collection. Empty if no such type was copied
-
getSourcePrimitiveCount
public int getSourcePrimitiveCount(OsmPrimitiveType type)
Gets the number of source primitives for the given type.- Parameters:
type
- The type- Returns:
- The number of source primitives of that type
-
getStatistics
public Map<OsmPrimitiveType,Integer> getStatistics()
Gets the statistics of the source primitive counts. May contain no entries for unused types.- Returns:
- The statistics as map
-
-