|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.android.tools.lint.detector.api.LintUtils
public class LintUtils
Useful utility methods related to lint.
| Constructor Summary | |
|---|---|
LintUtils()
|
|
| Method Summary | |
|---|---|
static void |
copyFile(File src,
File target)
Copies a file |
static Set<String> |
difference(Set<String> a,
Set<String> b)
Computes the set difference a - b |
static boolean |
endsWith(String string,
String suffix)
Case insensitive ends with |
static String |
formatList(List<String> strings,
int maxItems)
Format a list of strings, and cut of the list at maxItems if the
number of items are greater. |
static int |
getChildCount(Node node)
Returns the number of children of the given node |
static List<Element> |
getChildren(Node node)
Returns the children elements of the given node |
static Set<String> |
intersection(Set<String> a,
Set<String> b)
Computes the set intersection a intersect b |
static boolean |
isFileBasedResourceType(com.android.resources.ResourceType type)
Determine if the given type corresponds to a resource that has a unique file |
static boolean |
isXmlFile(File file)
Returns true if the given file represents an XML file |
static byte[] |
readBytes(File src)
Reads the file contents of the given file and returns it as a byte array. |
static Set<String> |
union(Set<String> a,
Set<String> b)
Computes the set union a union b |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LintUtils()
| Method Detail |
|---|
public static String formatList(List<String> strings,
int maxItems)
maxItems if the
number of items are greater.
strings - the list of strings to print out as a comma separated listmaxItems - the maximum number of items to print
public static Set<String> difference(Set<String> a,
Set<String> b)
a - b
a - the set to subtract fromb - the set to subtract
a but not in b
public static Set<String> intersection(Set<String> a,
Set<String> b)
a intersect b
a - the first set to intersectb - the second set to intersect
a and in b
public static Set<String> union(Set<String> a,
Set<String> b)
a union b
a - the first set to addb - the second set to add
a or in bpublic static boolean isFileBasedResourceType(com.android.resources.ResourceType type)
type - the resource type to check
public static boolean isXmlFile(File file)
file - the file to be checked
public static boolean endsWith(String string,
String suffix)
string - the string to be tested whether it ends with the given
suffixsuffix - the suffix to check
string ends with suffix,
case-insensitively.public static List<Element> getChildren(Node node)
node - the parent node
public static int getChildCount(Node node)
node - the parent node
public static void copyFile(File src,
File target)
throws IOException
src - the file to copytarget - the filename to write the file into
IOException - if an I/O problem occurs
public static byte[] readBytes(File src)
throws IOException
src - the file to be read
IOException - if an I/O error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||