| java.lang.Object de.uka.ilkd.key.ocl.gf.Utils
Utils | public class Utils (Code) | | consists of a bunch of static methods, mostly for String
author: daniels |
Method Summary | |
public static void | cleanupFromUMLTypes(String grammarsDir) schedules all Eng, OCL and Ger grammar files for deletion. | static String | compactSpaces(String s) | public static int | countOccurances(String s, String toSearch) | public static String | getExtension(File f) Get the extension of a file. | public static int | indexOfNotEscaped(String s, String toBeFound) Searches for the first occurace not escaped with '\' of toBeFound in s. | public static int | indexOfNotEscaped(String s, String toBeFound, int startIndex) Searches for the first occurace not escaped with '\' of toBeFound in s. | public static String | removeQuotations(String s) Removes all parts, that are inside "quotation marks" from s. | public static String | replaceAll(String original, String toReplace, String replacement) | public static String | replaceNotEscaped(String working, String toBeReplaced, String replacement) | public static void | tickProgress(ProgressMonitor pm, int progress, String note) Sets the progress on the given ProgressMonitor and logs the current time.
Parameters: pm - the monitor which is to be updated. | public static String[] | vector2Array(Vector strings) |
cleanupFromUMLTypes | public static void cleanupFromUMLTypes(String grammarsDir)(Code) | | schedules all Eng, OCL and Ger grammar files for deletion.
Parameters: grammarsDir - The directory where those files are |
compactSpaces | static String compactSpaces(String s)(Code) | | just replace sequences of spaces with one space
Parameters: s - The string to be compacted the compacted result |
countOccurances | public static int countOccurances(String s, String toSearch)(Code) | | counts the occurances of toSearch in s
Parameters: s - The String in which the search shall take place Parameters: toSearch - The String that should be counted the number of occurances, 0 if s is null |
getExtension | public static String getExtension(File f)(Code) | | Get the extension of a file.
|
indexOfNotEscaped | public static int indexOfNotEscaped(String s, String toBeFound)(Code) | | Searches for the first occurace not escaped with '\' of toBeFound in s.
Works like String::indexOf otherwise
Parameters: s - the String to search in Parameters: toBeFound - the String to search for the index of toBeFound, -1 if not found (or only escaped) |
indexOfNotEscaped | public static int indexOfNotEscaped(String s, String toBeFound, int startIndex)(Code) | | Searches for the first occurace not escaped with '\' of toBeFound in s.
Works like String::indexOf otherwise
Parameters: s - the String to search in Parameters: toBeFound - the String to search for Parameters: startIndex - the index in s, from which the search starts the index of toBeFound, -1 if not found (or only escaped) |
removeQuotations | public static String removeQuotations(String s)(Code) | | Removes all parts, that are inside "quotation marks" from s.
Assumes no nesting of those, like in Java.
" escaped with \ like \" do not count as quotation marks
Parameters: s - The String, that possibly contains quotations a String described above, s without quotations. |
replaceAll | public static String replaceAll(String original, String toReplace, String replacement)(Code) | | a simple replaceAll replacement, that uses NO regexps
and thus needs no freaking amount of backslashes
Parameters: original - The String in which the replacements should take place Parameters: toReplace - the String literal that is to be replaced Parameters: replacement - the replacement string original, but with replacements |
replaceNotEscaped | public static String replaceNotEscaped(String working, String toBeReplaced, String replacement)(Code) | | Replaces all occurances of toBeReplaced, that are not escaped by '\'
with replacement
Parameters: working - the String in which substrings should be replaced Parameters: toBeReplaced - The substring, that should be replaced by replacement Parameters: replacement - well, the replacement string The String with the replaced parts |
tickProgress | public static void tickProgress(ProgressMonitor pm, int progress, String note)(Code) | | Sets the progress on the given ProgressMonitor and logs the current time.
Parameters: pm - the monitor which is to be updated. If null, only logging is done Parameters: progress - The progress in absolute ticks Parameters: note - The note that is to be displayed above the progress monitor |
vector2Array | public static String[] vector2Array(Vector strings)(Code) | | Takes an arbitrary Vector and executes toString on each element and
puts these into a String[] of the same size as the Vector
Parameters: strings - A Vector of Object, preferably String The Vector as a String[] |
|
|