001/** 002 * Unit-API - Units of Measurement API for Java 003 * Copyright (c) 2014 Jean-Marie Dautelle, Werner Keil, V2COM 004 * All rights reserved. 005 * 006 * See LICENSE.txt for details. 007 */ 008package javax.measure.format; 009 010/** 011 * Represents a function that parses an input value and produces an output. 012 * 013 * <p> 014 * This is a <a href= 015 * "http://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html#package.description" 016 * >functional interface</a> whose functional method is {@link #parse()}. 017 * 018 * @author <a href="mailto:[email protected]">Werner Keil</a> 019 * @version 0.5, 2014-08-11 020 * @param <I> 021 * the input 022 * @param <O> 023 * the output 024 * @see ParserException 025 */ 026// equivalent to @FunctionalInterface 027public interface Parser<I, O> { 028 /** 029 * Parses the specified {@code I} to produce a {@code O}. 030 * @throws ParserException if any problem occurs while parsing the 031 * specified input (e.g. illegal syntax). 032 */ 033 O parse(I input) throws ParserException; 034}