コード例 #1
0
ファイル: IndexedSeq.java プロジェクト: norbson/javaslang
 @Override
 default boolean endsWith(Seq<? extends T> that) {
   Objects.requireNonNull(that, "that is null");
   if (that instanceof IndexedSeq) {
     int i = length() - 1;
     int j = that.length() - 1;
     if (j > i) {
       return false;
     } else {
       while (j >= 0) {
         if (!Objects.equals(this.get(i), that.get(j))) {
           return false;
         }
         i--;
         j--;
       }
       return true;
     }
   } else {
     return Seq.super.endsWith(that);
   }
 }
コード例 #2
0
ファイル: JFunction.java プロジェクト: jx2zhou/lavazard
 public void checkArguments(Seq argv) throws IllegalArgumentException {
   if (argv.length() != argc)
     throw new IllegalArgumentException(argv.length() + " != argc:" + argc);
 }