Example usage for java.lang Character hashCode

List of usage examples for java.lang Character hashCode

Introduction

In this page you can find the example usage for java.lang Character hashCode.

Prototype

@Override
public int hashCode() 

Source Link

Document

Returns a hash code for this Character ; equal to the result of invoking charValue() .

Usage

From source file:Main.java

public static void main(String[] args) {
    Character c1 = new Character('z');
    Character c2 = new Character('Z');

    int i1 = c1.hashCode();
    int i2 = c2.hashCode();

    String str1 = "Hashcode of " + c1 + " is " + i1;
    String str2 = "Hashcode of " + c2 + " is " + i2;

    System.out.println(str1);//from   www.j a v a  2s  .  c  o m
    System.out.println(str2);
}

From source file:eu.fbk.dh.tint.tokenizer.ItalianTokenizer.java

public boolean isSeparatorChar(Character ch) {
        if (splittingChars.size() > 0) {
            return splittingChars.contains(ch.hashCode());
        } else if (ch == CharacterTable.SPACE) {
            return true;
        } else if (ch == CharacterTable.CARRIADGE_RETURN) {
            return true;
        } else if (ch == CharacterTable.LINE_FEED) {
            return true;
        } else if (ch == CharacterTable.HORIZONTAL_TABULATION) {
            return true;
        } else if (ch == CharacterTable.FORM_FEED) {
            return true;
        }/*from ww w.j ava 2 s.  c o m*/

        return false;
    }