Package uk.ac.starlink.ttools.task
Interface WordParser<W>
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface WordParser<W>
Defines a parser which can turn a string into some other value.- Since:
- 9 May 2006
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description W
parseWord(java.lang.String word)
Parses a string to return a value of some kind.
-
-
-
Method Detail
-
parseWord
W parseWord(java.lang.String word) throws uk.ac.starlink.task.TaskException
Parses a string to return a value of some kind. If the word cannot be parsed, aTaskException
, preferably with an explanatory (user-directed) message, should be thrown. This method serves the purpose of validation as well as translation.- Parameters:
word
- string form- Returns:
- parsed value
- Throws:
uk.ac.starlink.task.TaskException
-
-