Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/core/text/TextSearchMatchAccess.java

Issue 10387008: External file text search engine support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/core/text/TextSearchMatchAccess.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/core/text/TextSearchMatchAccess.java (revision 7355)
+++ editor/tools/plugins/com.google.dart.tools.search/src/com/google/dart/tools/search/core/text/TextSearchMatchAccess.java (working copy)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, the Dart project authors.
+ * Copyright (c) 2012, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -13,7 +13,9 @@
*/
package com.google.dart.tools.search.core.text;
-import org.eclipse.core.resources.IFile;
+import com.google.dart.tools.search.internal.ui.text.FileResource;
+import com.google.dart.tools.search.internal.ui.text.FileResourceMatch;
+import com.google.dart.tools.search.internal.ui.text.LineElement;
/**
* A {@link TextSearchMatchAccess} gives access to a pattern match found by the
@@ -31,25 +33,41 @@
public abstract class TextSearchMatchAccess {
/**
+ * Creates a match object based on the given line element info.
+ *
+ * @param lineElement the line element
+ * @return a match object
+ */
+ public abstract FileResourceMatch createMatch(LineElement lineElement);
+
+ /**
* Returns the file the match was found in.
*
* @return the file the match was found.
*/
- public abstract IFile getFile();
+ public abstract FileResource<?> getFile();
/**
- * Returns the offset of this search match.
+ * Returns the file's content at the given offsets.
*
- * @return the offset of this search match
+ * @param offset the offset of the requested content
+ * @param length the of the requested content
+ * @return the substring of the file's content
+ * @throws IndexOutOfBoundsException an {@link IndexOutOfBoundsException} is thrown when the
+ * <code>offset</code> or the <code>length</code> are negative or when
+ * <code>offset + length</code> is not less than the file content's length.
*/
- public abstract int getMatchOffset();
+ public abstract String getFileContent(int offset, int length);
/**
- * Returns the length of this search match.
+ * Returns a character of the file's content at the given offset
*
- * @return the length of this search match
+ * @param offset the offset
+ * @return the character at the given offset
+ * @throws IndexOutOfBoundsException an {@link IndexOutOfBoundsException} is thrown when the
+ * <code>offset</code> is negative or not less than the file content's length.
*/
- public abstract int getMatchLength();
+ public abstract char getFileContentChar(int offset);
/**
* Returns the length of this file's content.
@@ -59,25 +77,17 @@
public abstract int getFileContentLength();
/**
- * Returns a character of the file's content at the given offset
+ * Returns the length of this search match.
*
- * @param offset the offset
- * @return the character at the given offset
- * @throws IndexOutOfBoundsException an {@link IndexOutOfBoundsException} is thrown when the
- * <code>offset</code> is negative or not less than the file content's length.
+ * @return the length of this search match
*/
- public abstract char getFileContentChar(int offset);
+ public abstract int getMatchLength();
/**
- * Returns the file's content at the given offsets.
+ * Returns the offset of this search match.
*
- * @param offset the offset of the requested content
- * @param length the of the requested content
- * @return the substring of the file's content
- * @throws IndexOutOfBoundsException an {@link IndexOutOfBoundsException} is thrown when the
- * <code>offset</code> or the <code>length</code> are negative or when
- * <code>offset + length</code> is not less than the file content's length.
+ * @return the offset of this search match
*/
- public abstract String getFileContent(int offset, int length);
+ public abstract int getMatchOffset();
}

Powered by Google App Engine
This is Rietveld 408576698