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 TypeMethodDescriptionvoidcheckMisconfigured(BeanInstanceMap defaultInstances) Checks that a bean's properties conform to expectations.deriveFrom(Path source, boolean debugMode) Derives a new path from an existing path.intThe index of the last element (inclusive) for the range.intThe 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.io.input.bean.path.DerivePath
deriveFromMethods 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:AnchorBeanChecks that a bean's properties conform to expectations.- Overrides:
checkMisconfiguredin classAnchorBean<DerivePath>- Parameters:
defaultInstances- all available default instances if theDefaultInstanceannotation is used- Throws:
BeanMisconfiguredException- if the bean has not been configured properly as XML
-
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.
-