Class NameElementRange
Constructs a
Path
from a sub-range of the name-elements of the Path
.
The name-elements are a split of the Path
by the directory-separator. See the Path
Javadoc.
All indices begin at 0 (for the first element), and can also accept negative-indices which count backwards from the end.
e.g. -1 is the last element; -2 is the second-last element.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkMisconfigured
(BeanInstanceMap defaultInstances) Checks that a bean's properties conform to expectations.deriveFrom
(Path source, boolean debugMode) Derives a new path from an existing path.int
The index of the last element (inclusive) for the range.int
The index of the first element (inclusive) for the range.void
setIndexEnd
(int indexEnd) The index of the last element (inclusive) for the range.void
setIndexStart
(int indexStart) The index of the first element (inclusive) for the range.Methods inherited from class org.anchoranalysis.io.input.bean.path.DerivePath
deriveFrom
Methods inherited from class org.anchoranalysis.bean.AnchorBean
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
NameElementRange
public NameElementRange()
-
-
Method Details
-
checkMisconfigured
Description copied from class:AnchorBean
Checks that a bean's properties conform to expectations.- Overrides:
checkMisconfigured
in classAnchorBean<DerivePath>
- Parameters:
defaultInstances
- all available default instances if theDefaultInstance
annotation is used- Throws:
BeanMisconfiguredException
- if the bean has not been configured properly as XML
-
deriveFrom
Description copied from class:DerivePath
Derives a new path from an existing path.- Specified by:
deriveFrom
in classDerivePath
- Parameters:
source
- the path to derive from.debugMode
- true if debug-mode is activated- Returns:
- the derived path.
- Throws:
DerivePathException
- if anything goes wrong
-
getIndexStart
public int getIndexStart()The index of the first element (inclusive) for the range.Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.
-
setIndexStart
public void setIndexStart(int indexStart) The index of the first element (inclusive) for the range.Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.
-
getIndexEnd
public int getIndexEnd()The index of the last element (inclusive) for the range.Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.
-
setIndexEnd
public void setIndexEnd(int indexEnd) The index of the last element (inclusive) for the range.Zero-indexed. It can be negative, in which it counts backwards from the end. See class description.
-