|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mitre.cpe.common.Utilities
public class Utilities
A collection of utility functions for use with the org.mitre.cpe.matching and org.mitre.cpe.naming packages.
Constructor Summary | |
---|---|
Utilities()
|
Method Summary | |
---|---|
static boolean |
containsWildcards(java.lang.String string)
Searches string for special characters * and ? |
static int |
countEscapeCharacters(java.lang.String str,
int start,
int end)
Counts the number of escape characters in the string beginning and ending at the given indices |
static int |
getUnescapedColonIndex(java.lang.String str)
Searches a string for the first unescaped colon and returns the index of that colon |
static int |
indexOf(java.lang.String str1,
java.lang.String str2,
int off)
Searches a string for the first occurrence of another string, starting at a given offset. |
static boolean |
isAlphanum(java.lang.String c)
Returns true if the string contains only alphanumeric characters or the underscore character, false otherwise. |
static boolean |
isEvenNumber(int num)
Checks if given number is even or not |
static java.lang.String |
reverse(java.lang.String s)
Returns a copy of the given string in reverse order |
static java.lang.String |
strcat(java.lang.String... strings)
Concatenates an arbitrary number of strings, in the given order. |
static int |
strchr(java.lang.String s,
java.lang.String chr,
int off)
Searches a string for a character starting at a given offset. |
static int |
strlen(java.lang.String s)
Returns the number of characters in the given string. |
static java.lang.String |
substr(java.lang.String s,
int b,
int e)
Extracts the characters between b and e, from the string s. |
static java.lang.String |
toLowercase(java.lang.String s)
Converts all alphabetic characters in a String to lowercase. |
static void |
validateFS(java.lang.String in)
This function is not part of the reference implementation pseudo code found in the CPE 2.3 specification. |
static void |
validateURI(java.lang.String in)
This function is not part of the reference implementation pseudo code found in the CPE 2.3 specification. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utilities()
Method Detail |
---|
public static java.lang.String strcat(java.lang.String... strings)
strings
- strings to be concatenated
public static java.lang.String substr(java.lang.String s, int b, int e)
s
- the string which the substring should be extracted fromb
- beginning indexe
- ending index
public static int strlen(java.lang.String s)
s
- the string
public static int strchr(java.lang.String s, java.lang.String chr, int off)
s
- string to be searchedchr
- character to search foroff
- offset to start at
public static java.lang.String toLowercase(java.lang.String s)
s
- string to convert to lowercase
public static int indexOf(java.lang.String str1, java.lang.String str2, int off)
str1
- String to search.str2
- String to search for.off
- Integer offset or -1 if not found.public static boolean containsWildcards(java.lang.String string)
string
- String to be searched
public static boolean isEvenNumber(int num)
num
- number to check
public static int countEscapeCharacters(java.lang.String str, int start, int end)
str
- string to searchstart
- beginning indexend
- ending index
public static int getUnescapedColonIndex(java.lang.String str)
str
- string to search
public static boolean isAlphanum(java.lang.String c)
c
- the string in question
public static java.lang.String reverse(java.lang.String s)
s
- the string to be reversed
public static void validateURI(java.lang.String in) throws java.text.ParseException
java.text.ParseException
public static void validateFS(java.lang.String in) throws java.text.ParseException
java.text.ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |