/** * Sets the quote character to use. * <p> * The quote character is used to wrap data between the tokens. * This enables delimiters to be entered as data. * * @param quote the quote character to use * @return this, to enable chaining */ public StrTokenizer setQuoteChar(final char quote) { return setQuoteMatcher(StrMatcher.charMatcher(quote)); }
/** * Set the character to ignore. * <p> * This character is ignored when parsing the String, unless it is * within a quoted region. * * @param ignored the ignored character to use * @return this, to enable chaining */ public StrTokenizer setIgnoredChar(final char ignored) { return setIgnoredMatcher(StrMatcher.charMatcher(ignored)); }
/** * Replaces all the occurrences of variables in the given source object with * their matching values from the system properties. * * @param source the source text containing the variables to substitute, null returns null * @return the result of the replace operation */ public static String replaceSystemProperties(final Object source) { return new StrSubstitutor(StrLookup.systemPropertiesLookup()).replace(source); }
@Override public String getLongDescription() { return WordUtils.wrap(new StrBuilder() .appendln("Adamic-Adar measures the similarity between vertex neighborhoods and is " + "computed as the sum of the inverse logarithm of centerpoint degree over shared " + "neighbors.") .appendNewLine() .append("The algorithm result contains two vertex IDs and the similarity score.") .toString(), 80); }
/** * Appends a string buffer followed by a new line to this string builder. * Appending null will call {@link #appendNull()}. * * @param str the string buffer to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final StringBuffer str) { return append(str).appendNewLine(); }
/** {@inheritDoc} */ @Override public String getContent() { final String str = super.getContent(); if (str == null) { return StrBuilder.this.toString(); } return str; } }
@Override public StrBuilder append(final StrBuilder str) { count[0]++; return super.append(str); } @Override
/** * Replaces all the occurrences of variables within the given source * builder with their matching values from the resolver. * * @param source the builder to replace in, updated, null returns zero * @return true if altered */ public boolean replaceIn(final StrBuilder source) { if (source == null) { return false; } return substitute(source, 0, source.length()); }
/** * Gets the String content that the tokenizer is parsing. * * @return the string content being parsed */ @Override public String toString() { if (tokens == null) { return "StrTokenizer[not tokenized yet]"; } return "StrTokenizer" + getTokenList(); }
/** * Sets the field delimiter string. * * @param delim the delimiter string to use * @return this, to enable chaining */ public StrTokenizer setDelimiterString(final String delim) { return setDelimiterMatcher(StrMatcher.stringMatcher(delim)); }
/** * Sets the field delimiter character. * * @param delim the delimiter character to use * @return this, to enable chaining */ public StrTokenizer setDelimiterChar(final char delim) { return setDelimiterMatcher(StrMatcher.charMatcher(delim)); }
/** * Sets the variable suffix to use. * <p> * The variable suffix is the character or characters that identify the * end of a variable. This method allows a single character suffix to * be easily set. * * @param suffix the suffix character to use * @return this, to enable chaining */ public StrSubstitutor setVariableSuffix(final char suffix) { return setVariableSuffixMatcher(StrMatcher.charMatcher(suffix)); }
/** * Sets the variable prefix to use. * <p> * The variable prefix is the character or characters that identify the * start of a variable. This method allows a single character prefix to * be easily set. * * @param prefix the prefix character to use * @return this, to enable chaining */ public StrSubstitutor setVariablePrefix(final char prefix) { return setVariablePrefixMatcher(StrMatcher.charMatcher(prefix)); }
/** * Sets the variable default value delimiter to use. * <p> * The variable default value delimiter is the character or characters that delimit the * variable name and the variable default value. This method allows a single character * variable default value delimiter to be easily set. * * @param valueDelimiter the variable default value delimiter character to use * @return this, to enable chaining * @since 3.2 */ public StrSubstitutor setValueDelimiter(final char valueDelimiter) { return setValueDelimiterMatcher(StrMatcher.charMatcher(valueDelimiter)); }
/** * Constructs a tokenizer splitting on the specified character. * * @param input the string which is to be parsed, not cloned * @param delim the field delimiter character */ public StrTokenizer(final char[] input, final char delim) { this(input); setDelimiterChar(delim); }
/** * Checks whether there are any previous tokens that can be iterated to. * * @return true if there are previous tokens */ @Override public boolean hasPrevious() { checkTokenized(); return tokenPos > 0; }
@Override public String getLongDescription() { return WordUtils.wrap(new StrBuilder() .appendln("List all triangles graph.") .appendNewLine() .append("The algorithm result contains three vertex IDs. For the directed algorithm " + "the result contains an additional bitmask indicating the presence of the six " + "potential connecting edges.") .toString(), 80); }
@Override public String getLongDescription() { return WordUtils.wrap(new StrBuilder() .appendln("Jaccard Index measures the similarity between vertex neighborhoods and " + "is computed as the number of shared neighbors divided by the number of " + "distinct neighbors. Scores range from 0.0 (no shared neighbors) to 1.0 (all " + "neighbors are shared).") .appendNewLine() .append("The result contains two vertex IDs, the number of shared neighbors, and " + "the number of distinct neighbors.") .toString(), 80); }