public class ColorMap
extends java.lang.Object
Constructor | Description |
---|---|
ColorMap() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
contains(Pixel p) |
Determine whether the map contains a given pixel.
|
Pixel[] |
getSortedPixels() |
Get an array of the pixels in the map sorted by frequency.
|
int |
getValue(Pixel p) |
Retrieves the frequency with which a pixel was used.
|
void |
put(Pixel p,
int v) |
Adds an element to the map or updates its value if the key already
exists.
|
int |
size() |
The number of elements in the map.
|
public void put(Pixel p, int v)
p
- The Pixel to use as the key.v
- The int to use as the value.public boolean contains(Pixel p)
p
- The pixel to check for existence.public int getValue(Pixel p)
p
- The pixel whose frequency should be retrieved.public int size()
public Pixel[] getSortedPixels()