Java Code Examples for com.intellij.openapi.util.text.StringUtil#stringHashCode()
The following examples show how to use
com.intellij.openapi.util.text.StringUtil#stringHashCode() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ByLine.java From consulo with Apache License 2.0 | 5 votes |
private static int hashCode(@Nonnull CharSequence text, @Nonnull ComparisonPolicy policy) { switch (policy) { case DEFAULT: return StringUtil.stringHashCode(text); case TRIM_WHITESPACES: int offset1 = trimStart(text, 0, text.length()); int offset2 = trimEnd(text, offset1, text.length()); return StringUtil.stringHashCode(text, offset1, offset2); case IGNORE_WHITESPACES: return StringUtil.stringHashCodeIgnoreWhitespaces(text); default: throw new IllegalArgumentException(policy.name()); } }
Example 2
Source File: IdDataConsumer.java From consulo with Apache License 2.0 | 5 votes |
public void addOccurrence(CharSequence charSequence, int start, int end, int occurrenceMask) { final int hashCode = StringUtil.stringHashCode(charSequence, start, end); addOccurrence(hashCode,occurrenceMask); final int hashCodeNoCase = StringUtil.stringHashCodeInsensitive(charSequence, start, end); if (hashCodeNoCase != hashCode) { addOccurrence(hashCodeNoCase,occurrenceMask); } }
Example 3
Source File: IdDataConsumer.java From consulo with Apache License 2.0 | 5 votes |
public void addOccurrence(char[] chars, int start, int end, int occurrenceMask) { final int hashCode = StringUtil.stringHashCode(chars, start, end); addOccurrence(hashCode,occurrenceMask); final int hashCodeNoCase = StringUtil.stringHashCodeInsensitive(chars, start, end); if (hashCodeNoCase != hashCode) { addOccurrence(hashCodeNoCase,occurrenceMask); } }
Example 4
Source File: DiffString.java From consulo with Apache License 2.0 | 5 votes |
@Override public int hashCode() { int h = myHash; if (h == 0) { h = StringUtil.stringHashCode(myData, myStart, myStart + myLength); if (h == 0) h = 1; myHash = h; } return h; }
Example 5
Source File: ByteArrayCharSequence.java From consulo with Apache License 2.0 | 5 votes |
@Override public int hashCode() { int h = hash; if (h == 0) { hash = h = StringUtil.stringHashCode(this, myStart, myEnd); } return h; }
Example 6
Source File: ImmutableText.java From consulo with Apache License 2.0 | 5 votes |
/** * Returns the hash code for this text. * * @return the hash code value. */ @Override public int hashCode() { int h = hash; if (h == 0) { hash = h = StringUtil.stringHashCode(this, 0, length()); } return h; }
Example 7
Source File: IdIndexEntry.java From consulo with Apache License 2.0 | 4 votes |
public IdIndexEntry(String word, boolean caseSensitive) { this(caseSensitive? StringUtil.stringHashCode(word) : StringUtil.stringHashCodeInsensitive(word)); }
Example 8
Source File: CharSequenceHashingStrategy.java From consulo with Apache License 2.0 | 4 votes |
@Override public int computeHashCode(final CharSequence chars) { return myCaseSensitive ? StringUtil.stringHashCode(chars) : StringUtil.stringHashCodeInsensitive(chars); }
Example 9
Source File: CharArrayCharSequence.java From consulo with Apache License 2.0 | 4 votes |
@Override public int hashCode() { return StringUtil.stringHashCode(myChars, myStart, myEnd); }
Example 10
Source File: CharTableImpl.java From consulo with Apache License 2.0 | 4 votes |
private static int subSequenceHashCode(CharSequence sequence, int startOffset, int endOffset) { if (startOffset == 0 && endOffset == sequence.length()) { return StringUtil.stringHashCode(sequence); } return StringUtil.stringHashCode(sequence, startOffset, endOffset); }