Esempio n. 1
0
 public static final Map withLoopTestStrPut3(final int n) {
   final Map map = new HashMap();
   for (int i = 0; i < n; i++) {
     map.put(StringUtils.randomString(SystemUtils.e4), StringUtils.randomString(SystemUtils.e4));
   } // End of the for //
   return map;
 }
Esempio n. 2
0
  public static final List buildTestSortListSmall(int n) {
    /*
    (defn build-test-sort-list-small
            [n]
            ;;;;;
            (for [x (range n)]
              (random-string 100)))

          (defn build-test-sort-list-big
            "See: 'for' 'List comprehension. Takes a vector of one or more
           binding-form/collection-expr pairs, each followed by zero or more modifiers,
           and yields a lazy sequence of evaluations of expr.'"
            [n]
            ;;;;;
            ;; Build a collection of strings
            ;; each string will have 100k of data
            (for [x (range n)]
              (random-string 100000)))
     */
    final List list = new ArrayList(40);
    for (int i = 0; i < n; i++) {
      list.add(StringUtils.randomString(100));
    } // End of the for //
    return list;
  }
Esempio n. 3
0
  public static final List buildTestSortListBigLinked(int n) {

    final List list = new LinkedList();
    for (int i = 0; i < n; i++) {
      list.add(StringUtils.randomString(100000));
    } // End of the for //
    return list;
  }
Esempio n. 4
0
 public static final Map withLoopTestStrPut1(final int n) {
   /*
   (defn with-loop-test-str-put-1
           "Test the hash/key 'put'.  Use a tiny data value"
           [n]
           ;;;
           (loop [data {}
                  i    0]
             (if (< i n)
               ;; Perform operation:
               ;; (println "debug: " data)
               ;; Associate the keyword with the some 'data value'
               (recur (assoc data (keyword (random-string 80)) "test-tiny-data")
                      (+ i 1))
               data)))
   */
   final Map map = new HashMap();
   for (int i = 0; i < n; i++) {
     map.put(StringUtils.randomString(80), "test-tiny-data");
   } // End of the for //
   return map;
 }