com.android.tools.lint.detector.api
Enum Location.SearchDirection

java.lang.Object
  extended by java.lang.Enum<Location.SearchDirection>
      extended by com.android.tools.lint.detector.api.Location.SearchDirection
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Location.SearchDirection>
Enclosing class:
Location

public static enum Location.SearchDirection
extends java.lang.Enum<Location.SearchDirection>

Whether to look forwards, or backwards, or in both directions, when searching for a pattern in the source code to determine the right position range for a given symbol.

When dealing with bytecode for example, there are only line number entries within method bodies, so when searching for the method declaration, we should only search backwards from the first line entry in the method.


Enum Constant Summary
BACKWARD
          Only search backwards
EOL_BACKWARD
          Search backwards from the current end of line (normally it's the beginning of the current line)
FORWARD
          Only search forwards
NEAREST
          Search both forwards and backwards from the given line, and prefer the match that is closest
 
Method Summary
static Location.SearchDirection valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Location.SearchDirection[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FORWARD

public static final Location.SearchDirection FORWARD
Only search forwards


BACKWARD

public static final Location.SearchDirection BACKWARD
Only search backwards


EOL_BACKWARD

public static final Location.SearchDirection EOL_BACKWARD
Search backwards from the current end of line (normally it's the beginning of the current line)


NEAREST

public static final Location.SearchDirection NEAREST
Search both forwards and backwards from the given line, and prefer the match that is closest

Method Detail

values

public static Location.SearchDirection[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Location.SearchDirection c : Location.SearchDirection.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Location.SearchDirection valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null