Package lombok

Examples of lombok.val.toArray()


        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

  {
    val result = new ReifiedArrayList<T>(componentType);
    while (enumeration.hasMoreElements())
      result.add(enumeration.nextElement());

    return result.toArray();
  }

  /**
   * Converts a list to an array.
   *
 
View Full Code Here

    val result = new ReifiedArrayList<Pair<TResult1, TResult2>>(DEFAULT_LIST_SIZE, Pair.class);

    for (T item : values)
      result.add(func.apply(item));

    return result.toArray();
  }

  /**
   * Returns a subset of the provided sequence, which conforms to the given predicate i.e. acts like a Where LINQ function It will never
   * return null.
View Full Code Here

    // if no separators, return the original string
    if (delimiters.length == 0)
    {
      result.add(text);
      return result.toArray();
    }

    int lastFound = 0;
    int index = 0;
View Full Code Here

      result.add(CONSTANT.EMPTY_STRING);

    switch(options)
    {
      case None:
        return result.toArray();
      case RemoveEmptyEntries:
        return Linq.where(result.toArray(), isNotNullOrEmpty());
      default:
        throw new IllegalArgumentException("stringSplitOptions has an unexpected value: " + options.toString());
    }
View Full Code Here

    switch(options)
    {
      case None:
        return result.toArray();
      case RemoveEmptyEntries:
        return Linq.where(result.toArray(), isNotNullOrEmpty());
      default:
        throw new IllegalArgumentException("stringSplitOptions has an unexpected value: " + options.toString());
    }
  }
View Full Code Here

          text = text.substring(parts.get(0).length() + 1);
        }
      }
    }

    return result.toArray();
  }

  /**
   * Splits a string by finding consecutive 'tags' i.e. delimiters. E.g. for 0d1h2m3s, using "d,h,m,s" as delimiters would return { 0,1,2,3
   * }. Delimiters that are not found will be ignored. E.g. for 0d1h2m3s, using "d,m,h,s" as delimiters would return { 0,1h2,3 } (i.e. h not
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.