Example usage for org.eclipse.jdt.core.compiler CharOperation lastIndexOf

List of usage examples for org.eclipse.jdt.core.compiler CharOperation lastIndexOf

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.compiler CharOperation lastIndexOf.

Prototype

public static final int lastIndexOf(char toBeFound, char[] array, int startIndex) 

Source Link

Document

Answers the last index in the array for which the corresponding character is equal to toBeFound stopping at the index startIndex.

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.search.matching.RoleTypePattern.java

License:Open Source License

public void decodeIndexKey(char[] key) {
    this.modifiers = 0;

    int slash = CharOperation.lastIndexOf(SEPARATOR, key, 0);
    if (slash > 0) {
        String mods = String.valueOf(CharOperation.subarray(key, slash + 1, key.length));
        try {//from w ww . j a v a  2 s.  c  o  m
            this.modifiers = Integer.parseInt(mods);
        } catch (NumberFormatException ex) {
            // ignore
            //ex.printStackTrace(); // just for testing
        }
    }

    super.decodeIndexKey(CharOperation.subarray(key, 0, slash));
}