Package gov.nih.mipav.model.algorithms
Class ContourPlot.GenericKey
java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.GenericKey
- Enclosing class:
ContourPlot
The GenericKey class can be used as key in
This is for example used by the atlas collection in
HashMaps when
multiple objects should be combined to a single key.
The hash key is then generated using Arrays.hashCode(Object[])
on the objects combined in this key.
This is for example used by the atlas collection in
ContourPlot.CharacterAtlas
where the attributes fontSize, style and antialiasing are used to
lookup the correct atlas.- Author:
- hageldave
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetComponent(int i) Returns the component at specified index<T> TgetComponent(int i, Class<T> clazz) Returns the component at specified index casted to the specified typeinthashCode()int
-
Field Details
-
keycontents
-
-
Constructor Details
-
GenericKey
Creates a new key from the specified objects- Parameters:
objects- the objects to form a key from (ordering changes hash)
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
numComponents
public int numComponents()- Returns:
- the number of components this key consists of
-
getComponent
Returns the component at specified index- Parameters:
i- index- Returns:
- key component
-
getComponent
Returns the component at specified index casted to the specified type- Type Parameters:
T- type of the component- Parameters:
i- indexclazz- type to cast to- Returns:
- key component
-