All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ranksys.formats.parsing.Parser Maven / Gradle / Ivy

Go to download

RankSys module, providing utilities for reading and writing into different formats of preference data, recommendations, etc.

The newest version!
/* 
 * Copyright (C) 2015 Information Retrieval Group at Universidad Autónoma
 * de Madrid, http://ir.ii.uam.es
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
package org.ranksys.formats.parsing;

import java.util.function.Function;

/**
 * Interface to parse a CharSequence.
 *
 * @author Saúl Vargas ([email protected])
 *
 * @param  type of the resulting object
 */
public interface Parser extends Function {

    /**
     * Parse a CharSequence into an object of type T.
     *
     * @param from input string
     * @return the object resulting from the parsing
     */
    public T parse(CharSequence from);

    @Override
    public default T apply(CharSequence from) {
        return parse(from);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy