Package lombok

Examples of lombok.val.toArray()


  {
    val result = new ReifiedArrayList<Double>(doubles.length, Double.class);
    for (double val : doubles)
      result.add(val);

    return result.toArray();
  }

  /**
   * Converts a boolean[] to a Boolean list.
   *
 
View Full Code Here


      {
        set.add(item);
        list.add(item);
      }

    return list.toArray();
  }

  /**
   * Returns the element at the given position in the provided sequence.
   *
 
View Full Code Here

      }
      catch(ClassCastException e)
      {}
    }

    return result.toArray();
  }

  /**
   * Orders a sequence by a specified key.
   *
 
View Full Code Here

    val result = new ReifiedArrayList<TResult>(DEFAULT_LIST_SIZE, keySelector.getParameterType1());
    for (List<TResult> list : dict.values())
      result.addAll(list);

    return result.toArray();
  }

  /**
   * Orders a sequence by a specified key.
   *
 
View Full Code Here

    // get all secondary dictionaries
    for (TreeMap<TKey2, List<TResult>> tree : dict.values())
      for (List<TResult> list : tree.values())
        result.addAll(list);

    return result.toArray();
  }

  /**
   * Partitions the given values based on a predicate. Matching values are first, non-matching second.
   *
 
View Full Code Here

      if (predicate.evaluate(item))
        matching.add(item);
      else
        nonMatching.add(item);

    return new Pair<T[], T[]>(matching.toArray(), nonMatching.toArray());
  }

  /**
   * Returns a range from the provided sequence. Inclusiveness is [start, finish) i.e. as in a For loop.
   *
 
View Full Code Here

        parts.get(parts.size() - 1).add(item);
      else
        parts.add(new ArrayList<T>(DEFAULT_LIST_SIZE));
    }

    return where(parts.toArray(), isNotEmpty);
  }

  /**
   * Splits a sequence into parts delimited by the specified delimited. Empty entries between delimiters are removed.
   *
 
View Full Code Here

        parts.get(parts.size() - 1).add(item);
      else
        parts.add(new ArrayList<T>(DEFAULT_LIST_SIZE));
    }

    return where(parts.toArray(), isNotEmpty);
  }

  /**
   * Splits a sequence into parts delimited by the specified delimited. Empty entries between delimiters are removed.
   *
 
View Full Code Here

        parts.get(parts.size() - 1).add(item);
      else
        parts.add(new ArrayList<T>(DEFAULT_LIST_SIZE));
    }

    return where(parts.toArray(), isNotEmpty);
  }

  /**
   * Splits a sequence into parts delimited by the specified delimited. Empty entries between delimiters are removed.
   *
 
View Full Code Here

        parts.add(new ArrayList<T>(DEFAULT_LIST_SIZE));
    }

    List<T> result = new ArrayList<T>(DEFAULT_LIST_SIZE);

    return where(parts.toArray(), isNotEmpty);
  }

  /**
   * Swaps two elements in an array.
   *
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.