public class SizeSelector extends BaseExtendSelector
| Modifier and Type | Class and Description |
|---|---|
static class |
SizeSelector.ByteUnits
Enumerated attribute with the values for units.
|
static class |
SizeSelector.SizeComparisons |
| Modifier and Type | Field and Description |
|---|---|
static String |
SIZE_KEY
Used for parameterized custom selector
|
static String |
UNITS_KEY
Used for parameterized custom selector
|
static String |
WHEN_KEY
Used for parameterized custom selector
|
parameters| Constructor and Description |
|---|
SizeSelector()
Creates a new
SizeSelector instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSelected(InstallData idata,
File basedir,
String filename,
File file)
The heart of the matter.
|
void |
setParameters(Parameter[] parameters)
When using this as a custom selector, this method will be called.
|
void |
setUnits(SizeSelector.ByteUnits units)
Sets the units to use for the comparison.
|
void |
setValue(long size)
A size selector needs to know what size to base its selecting on.
|
void |
setWhen(SizeSelector.SizeComparisons scmp)
This specifies when the file should be selected, whether it be
when the file matches a particular size, when it is smaller,
or whether it is larger.
|
String |
toString()
Returns a
String object representing the specified
SizeSelector. |
void |
verifySettings()
Checks to make sure all settings are kosher.
|
getParametersgetError, setError, validategetDescription, isChecked, noChildrenAllowed, setChecked, setDescription, tooManyAttributespublic static final String SIZE_KEY
public static final String UNITS_KEY
public static final String WHEN_KEY
public String toString()
String object representing the specified
SizeSelector. This is "{sizeselector value: " + <"compare",
"less", "more", "equal"> + "}".public void setValue(long size)
size - the size to select against expressed in units.public void setUnits(SizeSelector.ByteUnits units)
units - The units to compare the size to, using an
EnumeratedAttribute.public void setWhen(SizeSelector.SizeComparisons scmp)
scmp - The comparison to perform, an EnumeratedAttribute.public void setParameters(Parameter[] parameters)
setParameters in interface ParameterizablesetParameters in class BaseExtendSelectorparameters - the complete set of parameters for this selector.public void verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the size attribute has been set (to a positive value), that the multiplier has a valid setting, and that the size limit is valid. Since the latter is a calculated value, this can only fail due to a programming error.
If a problem is detected, the setError() method is called.
verifySettings in class BaseSelectorpublic boolean isSelected(InstallData idata, File basedir, String filename, File file) throws Exception
isSelected in interface FileSelectorisSelected in class BaseExtendSelectorbasedir - A java.io.File object for the base directory.filename - The name of the file to check.file - A File object for this filename.Exception - if the selector was not configured correctlyCopyright © 2001–2025. All rights reserved.