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

jaskell.parsec.Ne Maven / Gradle / Ivy

Go to download

This is a utils library for java 8 project. It include parsec combinators and sql generators library.

There is a newer version: 2.9.2
Show newest version
package jaskell.parsec;

import java.io.EOFException;
import java.util.Objects;

/**
 * Created by Mars Liu on 2016-01-03.
 * Ne 即 not equals ,它期待下个信息项与给定值不相等.
 */
public class Ne implements Parsec {
    private final E item;

    @Override
    public E parse(State s) throws EOFException, ParsecException {
        E re = s.next();
        if (Objects.equals(re, item)) {
            String message = String.format("Expect a data not Equal %s", item);
            throw s.trap(message);
        }
        return re;
    }

    public Ne(E item){
        this.item = item;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy