|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.data.heatmap.Heatmap
public class Heatmap
Simple wrapper around a 2-D array representing a heatmap.
| Field Summary | |
|---|---|
static String |
FIELD_FILENAME
the field for the "filename" meta-data entry. |
static String |
FIELD_TIMESTAMP
the field for the "timestamp" meta-data entry. |
protected static DataPointComparator<HeatmapValue> |
m_Comparator
the singleton comparator. |
protected String |
m_ID
the ID of the heatmap (basically the filename). |
protected double[][] |
m_Map
the actual heat map. |
protected double |
m_Max
the maximum intensity value. |
protected double |
m_Min
the minimum intensity value. |
protected Notes |
m_Notes
the attached notes. |
protected Report |
m_Report
meta-information on the heatmap. |
| Constructor Summary | |
|---|---|
Heatmap(double[][] map)
Initializes the heatmap with the 2-D data. |
|
Heatmap(int rows,
int cols)
Initializes an empty heatmap with a given size. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(HeatmapValue e)
Adds the value specified by this value object. |
|
boolean |
addAll(Collection<? extends HeatmapValue> c)
Sets all the values stored in the collection in this heatmap. |
|
void |
assign(DataContainer<HeatmapValue> other)
Obtains the stored variables from the other data point, but not the actual data points. |
|
void |
clear()
Sets all values to 0.0. |
|
int |
compareTo(Object o)
Compares this object with the specified object for order. |
|
int |
compareToHeader(Object o)
Compares this object with the specified object for order. |
|
boolean |
contains(Object o)
Checks whether the heatmap contains the specified object. |
|
boolean |
containsAll(Collection<?> c)
Checks whether all of the items in the collection are stored in this heatmap. |
|
static Report |
createEmptyReport()
Returns an empty report. |
|
boolean |
equals(Object obj)
Checks whether the specified object has the same content as this one. |
|
boolean |
equalsHeader(Object obj)
Indicates whether some other chromatogram's header is "equal to" this ones. |
|
static Heatmap |
fromIntensityString(int rows,
int cols,
String intensity)
Creates a heatmap from the intensity string using the specified dimensions. |
|
double |
get(int pos)
Returns the map value the specified position from the top left corner of the map, wlkaing through row-wise. |
|
double |
get(int row,
int col)
Returns the map value at the specified location. |
|
Heatmap |
getClone()
Returns a clone of the object. |
|
DataPointComparator<HeatmapValue> |
getComparator()
Returns the comparator in use. |
|
Heatmap |
getHeader()
Returns an empty container with the same meta-data as this one. |
|
Heatmap |
getHeader(int height,
int width)
Returns an empty container with the same meta-data as this one, but with different dimensions of the map. |
|
int |
getHeight()
Returns the height of the map. |
|
String |
getID()
Returns the ID. |
|
double |
getMax()
Returns the largest value in the heatmap. |
|
double |
getMin()
Returns the smallest value in the heatmap. |
|
Notes |
getNotes()
Returns the currently stored notes. |
|
Report |
getReport()
Returns the report. |
|
int |
getWidth()
Returns the width of the map. |
|
int |
getX(int pos)
Returns the X location from the position. |
|
int |
getY(int pos)
Returns Y location from the position. |
|
boolean |
hasReport()
Checks whether a report is present. |
|
boolean |
isEmpty()
Only false if all values are 0.0. |
|
Iterator<HeatmapValue> |
iterator()
Returns an iterator over the elements in this collection. |
|
void |
mergeWith(DataContainer other)
Merges its own data with the one provided by the specified object. |
|
DataPointComparator<HeatmapValue> |
newComparator()
Returns a new instance of the default comparator. |
|
HeatmapValue |
newPoint()
Returns a new instance of a DataContainer point. |
|
boolean |
remove(Object o)
Sets the value at the location of the provided object to 0.0. |
|
boolean |
removeAll(Collection<?> c)
Sets all values in this heatmap to 0.0 for locations stored in the collection provided. |
|
protected void |
resetMinMax()
Resets the min/max values. |
|
boolean |
retainAll(Collection<?> c)
Always throws UnsupportedOperationException. |
|
void |
set(double[] values)
Sets all the values, if the size of the array matches this heatmap. |
|
void |
set(Double[] values)
Sets all the values, if the size of the array matches this heatmap. |
|
void |
set(int pos,
double value)
Sets the map value at the specified position from the top left corner of the map, walking through row-wise. |
|
void |
set(int row,
int col,
double value)
Sets the map value at the specified location. |
|
void |
setID(String value)
Sets the ID. |
|
void |
setReport(Report value)
Sets a new report. |
|
int |
size()
Returns the total amount of data points in the map. |
|
Heatmap |
submap(int row,
int col,
int height,
int width)
Returns the specified submap. |
|
HeatmapValue[] |
toArray()
Turns the heatmap into an array (row wise). |
|
|
toArray(HeatmapValue[] a)
Returns the stored points as array. |
|
Double[] |
toDoubleArray()
Turns the heatmap into a Double array (row wise). |
|
String |
toIntensityString()
Returns a comma-separated string of all the intensity values. |
|
List<HeatmapValue> |
toList()
Returns a list with the points. |
|
List<HeatmapValue> |
toList(DataPointComparator comparator)
Returns a list with the points. |
|
String |
toString()
Returns a short string representation. |
|
TreeSet<HeatmapValue> |
toTreeSet()
Returns a treeset with the points. |
|
TreeSet<HeatmapValue> |
toTreeSet(DataPointComparator<HeatmapValue> comparator)
Returns a treeset with the points, sorted according to the given comparator. |
|
protected void |
updateMinMax(double value)
Updates the min/max values. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
hashCode |
| Field Detail |
|---|
public static final String FIELD_FILENAME
public static final String FIELD_TIMESTAMP
protected static DataPointComparator<HeatmapValue> m_Comparator
protected String m_ID
protected double[][] m_Map
protected Report m_Report
protected Notes m_Notes
protected double m_Min
protected double m_Max
| Constructor Detail |
|---|
public Heatmap(int rows,
int cols)
rows - the number of rows in the mapcols - the number of cols in the mappublic Heatmap(double[][] map)
map - the map data| Method Detail |
|---|
public void setID(String value)
setID in interface MutableIDHandlervalue - the IDpublic String getID()
getID in interface IDHandlerpublic void setReport(Report value)
setReport in interface MutableReportHandler<Report>value - the new reportpublic boolean hasReport()
hasReport in interface ReportHandler<Report>public Report getReport()
getReport in interface ReportHandler<Report>protected void resetMinMax()
protected void updateMinMax(double value)
value - the new valuepublic double getMin()
Double.MAX_VALUE if only zeroes
in the heatmppublic double getMax()
Double.MIN_VALUE if only zeroes
in the heatmppublic int getHeight()
public int getWidth()
public int size()
size in interface Collection<HeatmapValue>public int getX(int pos)
pos - the position to get the X location for
public int getY(int pos)
pos - the position to retrieve the Y location for
public double get(int row,
int col)
row - the row indexcol - the column index
public double get(int pos)
pos - the position to retrieve
public void set(int row,
int col,
double value)
row - the row indexcol - the column indexvalue - the heat value to set (>= 0.0)
IllegalArgumentException - if negative value encountered
public void set(int pos,
double value)
pos - the position in the mapvalue - the heat value to set
IllegalArgumentException - if negative value encounteredpublic void set(double[] values)
values - the values to set
IllegalArgumentException - if array length and size of heatmap don't match
IllegalArgumentException - if negative values encounteredpublic void set(Double[] values)
values - the values to set
IllegalArgumentException - if array length and size of heatmap don't match
IllegalArgumentException - if negative values encounteredpublic Notes getNotes()
getNotes in interface NotesHandlerpublic Heatmap getClone()
getClone in interface CloneHandlergetClone in interface DataContainer<HeatmapValue>public String toString()
toString in class Objectpublic HeatmapValue[] toArray()
toArray in interface Collection<HeatmapValue>public Double[] toDoubleArray()
public int compareTo(Object o)
compareTo in interface Comparableo - the object to be compared.
ClassCastException - if the specified object's type prevents it
from being compared to this object.public int compareToHeader(Object o)
compareToHeader in interface DataContainer<HeatmapValue>o - the object to be compared.
ClassCastException - if the specified object's type prevents it
from being compared to this object.public boolean equalsHeader(Object obj)
equalsHeader in interface DataContainer<HeatmapValue>obj - the reference object with which to compare.
public boolean equals(Object obj)
equals in interface Collection<HeatmapValue>equals in class Objectobj - the object to compare
compareTo(Object)public Iterator<HeatmapValue> iterator()
iterator in interface Iterable<HeatmapValue>iterator in interface Collection<HeatmapValue>public void clear()
clear in interface Collection<HeatmapValue>public boolean isEmpty()
isEmpty in interface Collection<HeatmapValue>public <HeatmapValue> HeatmapValue[] toArray(HeatmapValue[] a)
toArray in interface Collection<HeatmapValue>array - ignored
public boolean add(HeatmapValue e)
add in interface Collection<HeatmapValue>e - the value to add
public boolean addAll(Collection<? extends HeatmapValue> c)
addAll in interface Collection<HeatmapValue>c - the collection to use
public boolean remove(Object o)
remove in interface Collection<HeatmapValue>o - the heatmap value with the coordinates to remove
public boolean removeAll(Collection<?> c)
removeAll in interface Collection<HeatmapValue>c - the collection of heatmap values, which locations
should be set to 0.0 in this heatmap
public boolean contains(Object o)
contains in interface Collection<HeatmapValue>o - the object to look for
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<HeatmapValue>c - the collection to check
public boolean retainAll(Collection<?> c)
retainAll in interface Collection<HeatmapValue>UnsupportedOperationException - if the clear operation
is not supported by this collectionpublic void mergeWith(DataContainer other)
mergeWith in interface Mergeable<DataContainer>other - the object to merge withpublic DataPointComparator<HeatmapValue> newComparator()
newComparator in interface DataContainer<HeatmapValue>public DataPointComparator<HeatmapValue> getComparator()
getComparator in interface DataContainer<HeatmapValue>public HeatmapValue newPoint()
newPoint in interface DataContainer<HeatmapValue>public Heatmap getHeader()
getHeader in interface DataContainer<HeatmapValue>
public Heatmap getHeader(int height,
int width)
height - the new height of the mapwidth - the new width of the map
public void assign(DataContainer<HeatmapValue> other)
assign in interface DataContainer<HeatmapValue>other - the data point to get the values frompublic List<HeatmapValue> toList()
toList in interface DataContainer<HeatmapValue>public List<HeatmapValue> toList(DataPointComparator comparator)
toList in interface DataContainer<HeatmapValue>public TreeSet<HeatmapValue> toTreeSet()
toTreeSet in interface DataContainer<HeatmapValue>public TreeSet<HeatmapValue> toTreeSet(DataPointComparator<HeatmapValue> comparator)
toTreeSet in interface DataContainer<HeatmapValue>comparator - the comparator to use
public Heatmap submap(int row,
int col,
int height,
int width)
row - the row of the top-left cornercol - the column of the top-left cornerheight - the height of the submapwidth - the width of the submappublic String toIntensityString()
public static Heatmap fromIntensityString(int rows,
int cols,
String intensity)
rows - the height of the heatmapcols - the width of the heatmapintensity - the comma-separated list of intensity values
public static Report createEmptyReport()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||