Package com.google.common.base

Examples of com.google.common.base.Splitter.limit()


   */
  private static String[] split(String stringToSplit, String separator,
      int limit) {
    Splitter splitter = Splitter.on(separator).trimResults();
    if (limit > 0) {
      splitter = splitter.limit(limit);
    }
    return Iterables.toArray(splitter.split(stringToSplit), String.class);
  }

  /**
 
View Full Code Here


        currentSplitter = Splitter.on(separator);
      }
     
      int limit = getConfigs().getInt(config, "limit", -1);
      if (limit > 0) {
        currentSplitter = currentSplitter.limit(limit);
      }
     
      this.addEmptyStrings = getConfigs().getBoolean(config, "addEmptyStrings", false);     
      if (outputFieldNames == null && !addEmptyStrings) {
        currentSplitter = currentSplitter.omitEmptyStrings();
View Full Code Here

        currentSplitter = Splitter.on(separator);
      }
     
      int limit = getConfigs().getInt(config, "limit", -1);
      if (limit > 0) {
        currentSplitter = currentSplitter.limit(limit);
      }
     
      this.addEmptyStrings = getConfigs().getBoolean(config, "addEmptyStrings", false);     
      if (outputFieldNames == null && !addEmptyStrings) {
        currentSplitter = currentSplitter.omitEmptyStrings();
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.