public class PixelSet extends com.google.common.collect.ForwardingSet<CameraPixel> implements CameraMapOverlay, Serializable, Iterable<CameraPixel>
Modifier and Type | Field and Description |
---|---|
Set<CameraPixel> |
set |
Constructor and Description |
---|
PixelSet() |
PixelSet(HashSet<Integer> set) |
Modifier and Type | Method and Description |
---|---|
void |
addByCHID(int chid)
Add a pixel by its chid
|
void |
clear() |
boolean |
containsAllCHIDs(int[] chids)
Test if every pixel whose chid is given in chids is in the pixel set
|
boolean |
containsCHID(int chid)
Test if the pixel with chid is in the set
|
protected Set<CameraPixel> |
delegate() |
static PixelSet |
fromBooleanArray(boolean[] mask)
Create a PixelSet from a boolean mask of length N_PIXELS
|
static PixelSet |
fromCHIDs(int[] chidArray)
Create a PixelSet from an integer array containing the chids of
the pixels to be added to the set.
|
int |
getDrawRank() |
void |
paint(Graphics2D g2,
FactHexMapDisplay map) |
void |
setColor(Color c) |
boolean[] |
toBooleanArray()
Convert pixelset to a boolean array, array[chid] == True means, that
the pixel is in the set.
|
int[] |
toCHIDArray()
Convert the set to an integer array of CHIDs
|
ArrayList<Integer> |
toCHIDArrayList() |
equals, hashCode, standardEquals, standardHashCode, standardRemoveAll
add, addAll, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, standardAddAll, standardClear, standardContains, standardContainsAll, standardIsEmpty, standardRemove, standardRetainAll, standardToArray, standardToArray, standardToString, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, iterator, spliterator
add, addAll, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
parallelStream, removeIf, stream
public Set<CameraPixel> set
public static PixelSet fromCHIDs(int[] chidArray)
chidArray
- integer array with pixel chidsprotected Set<CameraPixel> delegate()
delegate
in class com.google.common.collect.ForwardingSet<CameraPixel>
public void addByCHID(int chid)
chid
- of the pixel to be addedpublic boolean containsCHID(int chid)
chid
- public boolean containsAllCHIDs(int[] chids)
chids
- public int[] toCHIDArray()
public boolean[] toBooleanArray()
public static PixelSet fromBooleanArray(boolean[] mask)
mask
- boolean array, array[chid] == True means the pixel will be added to the Setpublic ArrayList<Integer> toCHIDArrayList()
public void setColor(Color c)
setColor
in interface CameraMapOverlay
public void paint(Graphics2D g2, FactHexMapDisplay map)
paint
in interface CameraMapOverlay
public void clear()
clear
in interface Collection<CameraPixel>
clear
in interface Set<CameraPixel>
clear
in class com.google.common.collect.ForwardingCollection<CameraPixel>
public int getDrawRank()
getDrawRank
in interface CameraMapOverlay
Copyright © 2019. All rights reserved.