public class SizeSelectors
extends java.lang.Object
SizeSelectors instances.| Modifier and Type | Class and Description |
|---|---|
static interface |
SizeSelectors.Filter
A size constraint to easily filter out
sizes in a list.
|
| Constructor and Description |
|---|
SizeSelectors() |
| Modifier and Type | Method and Description |
|---|---|
static SizeSelector |
and(SizeSelector... selectors)
Joins all the given selectors to create a new one that returns
the intersection of all the inputs.
|
static SizeSelector |
aspectRatio(AspectRatio ratio,
float delta)
Returns a new
SizeSelector that keeps only sizes
which respect the given AspectRatio. |
static SizeSelector |
biggest()
Returns a
SizeSelector that will order sizes from
the biggest to the smallest. |
static SizeSelector |
maxArea(int area)
Returns a new
SizeSelector that keeps only sizes
whose area is at most equal to the given area in pixels. |
static SizeSelector |
maxHeight(int height)
Returns a new
SizeSelector that keeps only sizes
whose height is at most equal to the given height. |
static SizeSelector |
maxWidth(int width)
Returns a new
SizeSelector that keeps only sizes
whose width is at most equal to the given width. |
static SizeSelector |
minArea(int area)
Returns a new
SizeSelector that keeps only sizes
whose area is at least equal to the given area in pixels. |
static SizeSelector |
minHeight(int height)
Returns a new
SizeSelector that keeps only sizes
whose height is at least equal to the given height. |
static SizeSelector |
minWidth(int width)
Returns a new
SizeSelector that keeps only sizes
whose width is at least equal to the given width. |
static SizeSelector |
or(SizeSelector... selectors)
Creates a new
SizeSelector that 'or's the given filters. |
static SizeSelector |
smallest()
Returns a
SizeSelector that will order sizes from
the smallest to the biggest. |
static SizeSelector |
withFilter(SizeSelectors.Filter filter)
Returns a new
SizeSelector with the given SizeSelectors.Filter. |
public static SizeSelector withFilter(@NonNull SizeSelectors.Filter filter)
SizeSelector with the given SizeSelectors.Filter.
This kind of selector will respect the order in the source array.filter - a filterpublic static SizeSelector maxWidth(int width)
SizeSelector that keeps only sizes
whose width is at most equal to the given width.width - the max widthpublic static SizeSelector minWidth(int width)
SizeSelector that keeps only sizes
whose width is at least equal to the given width.width - the min widthpublic static SizeSelector maxHeight(int height)
SizeSelector that keeps only sizes
whose height is at most equal to the given height.height - the max heightpublic static SizeSelector minHeight(int height)
SizeSelector that keeps only sizes
whose height is at least equal to the given height.height - the min heightpublic static SizeSelector aspectRatio(AspectRatio ratio, float delta)
SizeSelector that keeps only sizes
which respect the given AspectRatio. You can pass a tolerance
value to include aspect ratios that are slightly different.ratio - the desired aspect ratiodelta - a small tolerance valuepublic static SizeSelector biggest()
SizeSelector that will order sizes from
the biggest to the smallest. This means that the biggest size will be taken.public static SizeSelector smallest()
SizeSelector that will order sizes from
the smallest to the biggest. This means that the smallest size will be taken.public static SizeSelector maxArea(int area)
SizeSelector that keeps only sizes
whose area is at most equal to the given area in pixels.area - the max areapublic static SizeSelector minArea(int area)
SizeSelector that keeps only sizes
whose area is at least equal to the given area in pixels.area - the min areapublic static SizeSelector and(SizeSelector... selectors)
selectors - input selectorspublic static SizeSelector or(SizeSelector... selectors)
SizeSelector that 'or's the given filters.
If the first selector returns an empty list, the next selector is queried,
and so on until a non-empty list is found.selectors - input selectors