jaskell.parsec.Ne Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaskell-java8 Show documentation
Show all versions of jaskell-java8 Show documentation
This is a utils library for java 8 project.
It include parsec combinators and sql generators library.
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