edu.stanford.nlp.util.Function Maven / Gradle / Ivy
package edu.stanford.nlp.util;
/**
* An interface for classes that act as a function transforming one object
* to another.
*
* Implementation note: A function by itself is not serializable.
* We do however also provide an interface
* {@link edu.stanford.nlp.process.SerializableFunction} for
* the common case of a function that should be Serializable.
*
* @author Dan Klein
* @param The domain of the function
* @param The range of the function
*/
public interface Function {
/**
* Converts a T1 to a different T2. For example, a Parser
* will convert a Sentence to a Tree. A Tagger will convert a Sentence
* to a TaggedSentence.
*
* @param in The function's argument
* @return The function's evaluated value
*/
public T2 apply(T1 in);
}