KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > parsec > IsReturnParser


1 /**
2  *
3  */

4 package jfun.parsec;
5
6 final class IsReturnParser<R> extends Parser<R> {
7   private final ObjectPredicate<R> op;
8
9   IsReturnParser(String JavaDoc n, ObjectPredicate<R> op) {
10     super(n);
11     this.op = op;
12   }
13
14   boolean apply(final ParseContext ctxt) {
15     final Object JavaDoc r = ctxt.getReturn();
16     return op.isObject((R) r);
17   }
18 }
Popular Tags