use of org.eclipse.jdt.internal.core.index.Index in project che by eclipse.
the class IndexManager method resetIndex.
/**
* Resets the index for a given path.
* Returns true if the index was reset, false otherwise.
*/
public synchronized boolean resetIndex(IPath containerPath) {
// only called to over write an existing cached index...
String containerPathString = containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString();
try {
// Path is already canonical
IndexLocation indexLocation = computeIndexLocation(containerPath);
Index index = getIndex(indexLocation);
if (JobManager.VERBOSE) {
//$NON-NLS-1$ //$NON-NLS-2$
Util.verbose("-> reseting index: " + indexLocation + " for path: " + containerPathString);
}
if (index == null) {
// the index does not exist, try to recreate it
return recreateIndex(containerPath) != null;
}
index.reset();
return true;
} catch (IOException e) {
// The file could not be created. Possible reason: the project has been deleted.
if (JobManager.VERBOSE) {
//$NON-NLS-1$
Util.verbose("-> failed to reset index for path: " + containerPathString);
e.printStackTrace();
}
return false;
}
}
use of org.eclipse.jdt.internal.core.index.Index in project che by eclipse.
the class IndexManager method toString.
public String toString() {
StringBuffer buffer = new StringBuffer(10);
buffer.append(super.toString());
//$NON-NLS-1$
buffer.append("In-memory indexes:\n");
int count = 0;
Object[] valueTable = this.indexes.valueTable;
for (int i = 0, l = valueTable.length; i < l; i++) {
Index index = (Index) valueTable[i];
if (index != null)
//$NON-NLS-1$
buffer.append(++count).append(" - ").append(index.toString()).append('\n');
}
return buffer.toString();
}
Aggregations