Пример #1
0
 @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
 public void checkArguments(Seq argv) throws IllegalArgumentException {
   if (argv.length() != argc)
     throw new IllegalArgumentException(argv.length() + " != argc:" + argc);
 }