Package uk.ac.starlink.ttools.plot2
Class ReportMap
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.ReportMap
-
public class ReportMap extends java.lang.Object
Map containing typed entries generated as a result of plotting. The sequence in which entries are added is significant; general interest entries should be added in the order in which it makes sense for a UI to present them to the user.- Since:
- 9 Dec 2014
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
<T> T
get(ReportKey<T> key)
Retrieves an entry.int
hashCode()
java.util.Set<ReportKey<?>>
keySet()
Returns an ordered set of the keys actually present in this map.<T> void
put(ReportKey<T> key, T value)
Sets an entry.void
putAll(ReportMap report)
Copies all the entries from a given map into this map.java.lang.String
toString()
java.lang.String
toString(boolean includeAll)
Returns a string representation of this map, with an option to include or exclude the non-general-interest entries.
-
-
-
Constructor Detail
-
ReportMap
public ReportMap()
Constructs an empty map.
-
ReportMap
public ReportMap(ReportMap copy)
Constructs a map with the same content as a given template.- Parameters:
copy
- map whose contents are to be copied
-
-
Method Detail
-
put
public <T> void put(ReportKey<T> key, T value)
Sets an entry.- Parameters:
key
- keyvalue
- value
-
putAll
public void putAll(ReportMap report)
Copies all the entries from a given map into this map.- Parameters:
report
- map to copy
-
get
public <T> T get(ReportKey<T> key)
Retrieves an entry.- Parameters:
key
- key- Returns:
- associated value; if no entry present, null is returned
-
keySet
public java.util.Set<ReportKey<?>> keySet()
Returns an ordered set of the keys actually present in this map. The sequence is the order in which entries were set.- Returns:
- list of keys
-
toString
public java.lang.String toString(boolean includeAll)
Returns a string representation of this map, with an option to include or exclude the non-general-interest entries.- Parameters:
includeAll
- true to include all entries, false to include only general-interest entries- Returns:
- string representation of this map, zero-length if there are no items of interest
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-