Class NameElementRange
Object
org.anchoranalysis.bean.AnchorBean<DerivePath>
org.anchoranalysis.io.input.bean.path.DerivePath
org.anchoranalysis.io.input.bean.path.NameElementRange
public class NameElementRange extends DerivePath
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 Constructor Description NameElementRange() -
Method Summary
Modifier and Type Method Description voidcheckMisconfigured(BeanInstanceMap defaultInstances)PathderiveFrom(Path source, boolean debugMode)Derives a new path from an existing path.intgetIndexEnd()The index of the last element (inclusive) for the range.intgetIndexStart()The index of the first element (inclusive) for the range.voidsetIndexEnd(int indexEnd)The index of the last element (inclusive) for the range.voidsetIndexStart(int indexStart)The index of the first element (inclusive) for the range.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
- Overrides:
checkMisconfiguredin classAnchorBean<DerivePath>- Throws:
BeanMisconfiguredException
-
deriveFrom
Description copied from class:DerivePathDerives a new path from an existing path.- Specified by:
deriveFromin 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.
-