Example usage for org.eclipse.jdt.internal.compiler.util HashtableOfObjectToIntArray HashtableOfObjectToIntArray

List of usage examples for org.eclipse.jdt.internal.compiler.util HashtableOfObjectToIntArray HashtableOfObjectToIntArray

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.util HashtableOfObjectToIntArray HashtableOfObjectToIntArray.

Prototype

public HashtableOfObjectToIntArray() 

Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.JavadocContents.java

License:Open Source License

public String getFieldDoc(IField child) throws JavaModelException {
    if (this.content == null)
        return null;

    int[] range = null;
    synchronized (this) {
        if (this.fieldDocRanges == null) {
            this.fieldDocRanges = new HashtableOfObjectToIntArray();
        } else {/*from  w  w w.j a va 2  s  .  c o m*/
            range = this.fieldDocRanges.get(child);
        }

        if (range == null) {
            range = computeFieldRange(child);
            this.fieldDocRanges.put(child, range);
        }
    }

    if (range != null) {
        if (range == UNKNOWN_FORMAT)
            throw new JavaModelException(
                    new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, child));
        return String.valueOf(CharOperation.subarray(this.content, range[0], range[1]));
    }
    return null;
}

From source file:com.codenvy.ide.ext.java.server.internal.core.JavadocContents.java

License:Open Source License

public String getMethodDoc(IMethod child) throws JavaModelException {
    if (this.content == null)
        return null;

    int[] range = null;
    synchronized (this) {
        if (this.methodDocRanges == null) {
            this.methodDocRanges = new HashtableOfObjectToIntArray();
        } else {/* w  ww  . ja  v a 2 s  .c om*/
            range = this.methodDocRanges.get(child);
        }

        if (range == null) {
            range = computeMethodRange(child);
            this.methodDocRanges.put(child, range);
        }
    }

    if (range != null) {
        if (range == UNKNOWN_FORMAT) {
            throw new JavaModelException(
                    new JavaModelStatus(IJavaModelStatusConstants.UNKNOWN_JAVADOC_FORMAT, child));
        }
        return String.valueOf(CharOperation.subarray(this.content, range[0], range[1]));
    }
    return null;
}