Guava Splitter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava Splitter class.

This code example shows how to use the following methods:split
	private static final String SEPARATOR = "\t ";
	private static final Splitter onTabs = Splitter.on(SEPARATOR);
	private List<String> data;
 
	Line(String line) {
		data = Lists.newArrayList(onTabs.split(line));
	} 
 
	public double getDouble(int field) {
		return Double.parseDouble(data.get(field));
	} 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
   * Tokenizes a string using the simplest method.  This should be over-ridden for more subtle 
   * tokenization. 
   * @see LuceneTextValueEncoder 
   */ 
  protected Iterable<String> tokenize(CharSequence originalForm) {
    return ON_NON_WORD.split(originalForm);
  } 
 
  /** 
   * Converts a value into a form that would help a human understand the internals of how the value 
   * is being interpreted.  For text-like things, this is likely to be a list of the terms found with 
   * associated weights (if any). 
   * 
   * @param originalForm The original form of the value as a string. 
   * @return A string that a human can read. 
   */ 
  @Override 
  public String asString(String originalForm) {
    StringBuilder r = new StringBuilder();
    r.append('[');
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split, trimResults
    } 
 
    @Config("jmx.dump-tables") 
    public JmxConnectorConfig setDumpTables(String tableNames)
    { 
        this.dumpTables = ImmutableSet.copyOf(Splitter.on(',').omitEmptyStrings().trimResults().split(tableNames));
        return this;
    } 
 
    @MinDuration("1ms") 
    public Duration getDumpPeriod() 
    { 
        return dumpPeriod;
    } 
 
    @Config("jmx.dump-period") 
    public JmxConnectorConfig setDumpPeriod(Duration dumpPeriod)
    { 
        this.dumpPeriod = dumpPeriod;
        return this;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
   * Split on space & trim results. 
   * @param s the string to split 
   * @return an iterable of strings 
   */ 
  public static Iterable<String> split(CharSequence s) {
    return SSV_SPLITTER.split(s);
  } 
 
  /** 
   * Split on _ & trim results 
   * @param s the string to split 
   * @return an iterable of strings 
   */ 
  public static Iterable<String> _split(CharSequence s) {
    return _SPLITTER.split(s);
  } 
 
  /** 
   * Check whether a url is absolute or note 
   * @param url to check 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split, trimResults
    { 
        if (plugins == null) {
            this.plugins = null;
        } 
        else { 
            this.plugins = ImmutableList.copyOf(Splitter.on(',').omitEmptyStrings().trimResults().split(plugins));
        } 
        return this;
    } 
 
    @NotNull 
    public File getPluginConfigurationDir()
    { 
        return pluginConfigurationDir;
    } 
 
    @Config("plugin.config-dir") 
    public PluginManagerConfig setPluginConfigurationDir(File pluginConfigurationDir)
    { 
        this.pluginConfigurationDir = pluginConfigurationDir;
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
    public static final Random RAND = RandomUtils.getRandom();
 
    private final List<String> data;
 
    private Line(CharSequence line) {
      data = Lists.newArrayList(ON_TABS.split(line));
    } 
 
    private Line() { 
      data = Lists.newArrayList();
    } 
 
    public double getDouble(int field) {
      return Double.parseDouble(data.get(field));
    } 
 
    /** 
     * Generate a random line with 20 fields each with integer values. 
     * 
     * @return A new line with data. 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
         
        return row.build();
    } 
 
    private Iterable<String> keywords(String allKeywords) {
        return allKeywords == null ? ImmutableList.<String>of() : splitter.split(allKeywords);
    } 
     
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
 
        return keyword.build();
    } 
 
    private String extractResourceName(String uri) {
        return Iterables.getLast(splitter.split(uri));
    } 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
        return decodeFromString(familyString);
    } 
 
    @Override 
    public KeyValue unformatKeyValue(String keyValueString) {
        List<String> parts = Lists.newArrayList(SPLITTER.split(keyValueString));
        if (parts.size() != 3) {
            throw new IllegalArgumentException("Value cannot be split into row, column family, qualifier: "
                    + keyValueString);
        } 
        byte[] rowKey = decodeFromString(parts.get(0));
        byte[] columnFamily = decodeFromString(parts.get(1));
        byte[] columnQualifier = decodeFromString(parts.get(2));
        return new KeyValue(rowKey, columnFamily, columnQualifier);
    } 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:split
        } 
        return line;
    } 
     
    public List<String> split(String line) {
        return ImmutableList.copyOf(Iterables.transform(splitter.split(line), new Function<String, String>() {
            @Override 
            public String apply(String input) {
                return input.trim();
            } 
        })); 
    } 
     
    private boolean isComment(String line) {
        return line.startsWith("#");
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Guava Splitter Methods: