|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<Coord>
com.threerings.tudey.util.CoordSet
public class CoordSet
Contains a set of encoded coordinates.
| Constructor Summary | |
|---|---|
CoordSet()
Creates an empty coord set. |
|
CoordSet(Collection<Coord> collection)
Creates a coord set containing the contents of the supplied collection. |
|
CoordSet(int x,
int y,
int width,
int height)
Creates a coord set containing all of the coordinates in the supplied region. |
|
CoordSet(Rectangle region)
Creates a coord set containing all of the coordinates in the supplied region. |
|
| Method Summary | |
|---|---|
boolean |
add(Coord coord)
|
boolean |
add(int x,
int y)
Adds the specified coordinates to the set. |
boolean |
addAll(int x,
int y,
int width,
int height)
Adds all of the coordinates in the specified region. |
boolean |
addAll(Rectangle region)
Adds all of the coordinates in the specified region. |
boolean |
contains(int x,
int y)
Determines whether the set contains the specified coordinates. |
boolean |
contains(Object object)
|
boolean |
containsAll(int x,
int y,
int width,
int height)
Determines whether the set contains all of the coordinates in the specified region. |
boolean |
containsAll(Rectangle region)
Determines whether the set contains all of the coordinates in the specified region. |
CoordSet |
getBorder()
Creates a new set containing the coordinates that border the coordinates in this set. |
CoordSet |
getBorder(CoordSet result)
Adds the coordinates that border the coordinates in this set to the provided set. |
CoordSet |
getCardinalBorder()
Creates a new set containing the coordinates that border the coordinates in this set in the cardinal directions. |
CoordSet |
getCardinalBorder(CoordSet result)
Adds the coordinates that border the coordinates in this set in cardinal directions to the set provided. |
Rectangle |
getLargestRegion(Rectangle result)
Finds the largest covered region of this set and stores it in the provided rectangle. |
Iterator<Coord> |
iterator()
|
Coord |
pickRandom()
Selects and returns a random coordinate from the set. |
Coord |
pickRandom(Coord result)
Selects a random coordinate from the set and places it in the provided object. |
Coord |
pickRandom(int width,
int height)
Selects a random coordinate that is the origin of a region within the set with the supplied dimensions. |
Coord |
pickRandom(int width,
int height,
Coord result)
Selects a random coordinate that is the origin of a region within the set with the supplied dimensions and places it in the provided object. |
boolean |
remove(int x,
int y)
Removes the specified coordinates from the set. |
boolean |
remove(Object object)
|
boolean |
removeAll(int x,
int y,
int width,
int height)
Removes all of the coordinates in the specified region. |
boolean |
removeAll(Rectangle region)
Removes all of the coordinates in the specified region. |
int |
size()
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, containsAll, isEmpty, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public CoordSet(Collection<Coord> collection)
public CoordSet(Rectangle region)
public CoordSet(int x,
int y,
int width,
int height)
public CoordSet()
| Method Detail |
|---|
public boolean addAll(Rectangle region)
public boolean addAll(int x,
int y,
int width,
int height)
public boolean add(int x,
int y)
public boolean removeAll(Rectangle region)
public boolean removeAll(int x,
int y,
int width,
int height)
public boolean remove(int x,
int y)
public boolean containsAll(Rectangle region)
public boolean containsAll(int x,
int y,
int width,
int height)
public boolean contains(int x,
int y)
public Coord pickRandom()
public Coord pickRandom(Coord result)
public Coord pickRandom(int width,
int height)
public Coord pickRandom(int width,
int height,
Coord result)
public Rectangle getLargestRegion(Rectangle result)
public CoordSet getBorder()
public CoordSet getBorder(CoordSet result)
public CoordSet getCardinalBorder()
public CoordSet getCardinalBorder(CoordSet result)
public boolean add(Coord coord)
add in interface Collection<Coord>add in interface Set<Coord>add in class AbstractCollection<Coord>public boolean remove(Object object)
remove in interface Collection<Coord>remove in interface Set<Coord>remove in class AbstractCollection<Coord>public boolean contains(Object object)
contains in interface Collection<Coord>contains in interface Set<Coord>contains in class AbstractCollection<Coord>public int size()
size in interface Collection<Coord>size in interface Set<Coord>size in class AbstractCollection<Coord>public Iterator<Coord> iterator()
iterator in interface Iterable<Coord>iterator in interface Collection<Coord>iterator in interface Set<Coord>iterator in class AbstractCollection<Coord>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||