public static class Rectangle.Utils extends Object
Room
Modifier and Type | Field and Description |
---|---|
static Comparator<Rectangle> |
SIZE_COMPARATOR
A comparator that uses
size(Rectangle) as the measure. |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static Iterator<Coord> |
cells(Rectangle r)
Use
cellsList(Rectangle) if you want them all. |
static List<Coord> |
cellsList(Rectangle r)
Use
cellsList(Rectangle) if you may stop before the end of
the list, you'll save some memory. |
static Coord |
center(Rectangle r) |
static boolean |
contains(Iterable<? extends Rectangle> rs,
Coord c) |
static boolean |
contains(Rectangle r,
Coord c) |
static boolean |
containsAny(Rectangle r,
Collection<Coord> cs) |
static Rectangle |
extend(Rectangle r,
Direction d) |
static int |
size(Rectangle r) |
public static final Comparator<Rectangle> SIZE_COMPARATOR
size(Rectangle)
as the measure.public Utils()
public static boolean contains(Rectangle r, Coord c)
r
- c
- r
contains c
.public static boolean containsAny(Rectangle r, Collection<Coord> cs)
r
- c
- true
if r
contains a member of cs
.public static boolean contains(Iterable<? extends Rectangle> rs, Coord c)
rs
- c
- true
if a member of rs
contains
c
.public static int size(Rectangle r)
r
- r
covers.public static Iterator<Coord> cells(Rectangle r)
cellsList(Rectangle)
if you want them all.r
- r
contains, from bottom left to top
right; lazily computed.public static List<Coord> cellsList(Rectangle r)
cellsList(Rectangle)
if you may stop before the end of
the list, you'll save some memory.r
- r
contains, from bottom left to top
right.Copyright © 2012–2016. All rights reserved.