Package uk.ac.starlink.ttools.plot2
Class ReportMap
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.ReportMap
-
public class ReportMap extends java.lang.ObjectMap 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 booleanequals(java.lang.Object o)<T> Tget(ReportKey<T> key)Retrieves an entry.inthashCode()java.util.Set<ReportKey<?>>keySet()Returns an ordered set of the keys actually present in this map.<T> voidput(ReportKey<T> key, T value)Sets an entry.voidputAll(ReportMap report)Copies all the entries from a given map into this map.java.lang.StringtoString()java.lang.StringtoString(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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-