public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static int |
count(String s,
char x) |
static String |
escapeWhitespace(String s,
boolean escapeSpaces) |
static String |
expandTabs(String s,
int tabSize) |
static <T> String |
join(Iterator<T> iter,
String separator) |
static <T> String |
join(T[] array,
String separator) |
static String |
newlines(int n) |
static int |
numNonnull(Object[] data) |
static char[] |
readFile(String fileName) |
static char[] |
readFile(String fileName,
String encoding) |
static <T> void |
removeAllElements(Collection<T> data,
T value) |
static String |
sequence(int n,
String s) |
static String |
spaces(int n) |
static char[] |
toCharArray(IntegerList data) |
static Map<String,Integer> |
toMap(String[] keys)
Convert array of strings to string→index map.
|
static IntervalSet |
toSet(BitSet bits) |
static void |
writeFile(String fileName,
String content) |
static void |
writeFile(String fileName,
String content,
String encoding) |
public static int numNonnull(Object[] data)
public static <T> void removeAllElements(Collection<T> data, T value)
public static void writeFile(String fileName, String content) throws IOException
IOException
public static void writeFile(String fileName, String content, String encoding) throws IOException
IOException
public static char[] readFile(String fileName) throws IOException
IOException
public static char[] readFile(String fileName, String encoding) throws IOException
IOException
public static Map<String,Integer> toMap(String[] keys)
public static char[] toCharArray(IntegerList data)
public static IntervalSet toSet(BitSet bits)
public static String spaces(int n)
public static String newlines(int n)
public static int count(String s, char x)
Copyright © 1992–2020 ANTLR. All rights reserved.