示例#1
0
 /** Returns the list obtained from 'l' after removing all elements 'elem' */
 public static <A> List<A> filter(List<A> l, A elem) {
   Assert.checkNonNull(elem);
   List<A> res = List.nil();
   for (A a : l) {
     if (a != null && !a.equals(elem)) {
       res = res.prepend(a);
     }
   }
   return res.reverse();
 }
示例#2
0
 public void setWriter(WriterKind kind, PrintWriter pw) {
   Assert.checkNonNull(pw);
   switch (kind) {
     case NOTICE:
       noticeWriter = pw;
       break;
     case WARNING:
       warnWriter = pw;
       break;
     case ERROR:
       errWriter = pw;
       break;
     default:
       throw new IllegalArgumentException();
   }
 }
示例#3
0
 public void setWriters(PrintWriter pw) {
   noticeWriter = warnWriter = errWriter = Assert.checkNonNull(pw);
 }
示例#4
0
 public void setEndPosTable(JavaFileObject name, EndPosTable endPosTable) {
   Assert.checkNonNull(name);
   getSource(name).setEndPosTable(endPosTable);
 }
示例#5
0
 public Enum(Type type, VarSymbol value) {
   super(type);
   this.value = Assert.checkNonNull(value);
 }