4A Server -  2.0
 All Classes Namespaces Files Functions Variables Enumerator
cz.vutbr.fit.knot.annotations.comet.Util Class Reference

Utility class (manipulates RFC 3339 dates) More...

Collaboration diagram for cz.vutbr.fit.knot.annotations.comet.Util:
Collaboration graph

Static Public Member Functions

static java.util.Date parseRFC3339Date (String datestring) throws java.text.ParseException, IndexOutOfBoundsException
 
static java.util.Date parseDate (String datestring) throws java.text.ParseException, IndexOutOfBoundsException
 
static java.util.Date parseTime (String datestring) throws java.text.ParseException, IndexOutOfBoundsException
 
static String toRFC3339Date (Date date)
 
static String toRFC3339DateOnly (Date date)
 
static String toRFC3339DateOnlyWTZ (Date date)
 
static String toRFC3339Time (Date date)
 
static int minimum (int a, int b, int c)
 
static int levenshtein (String s, String t)
 
static String escapeForXml (String str)
 
static String parseTimeZoneID (String date)
 
static String toHTMLString (String source)
 

Static Public Attributes

static final int RESERVED_CHARS = 0
 
static final int TEXTUAL_CHARS = 1
 
static final int NUMERAL_CHARS = 2
 
static final int TEXTUAL_MAX_SIZE = 8
 
static final int NUMERAL_MAX_SIZE = 4
 
static final String START_OF_TEXTUAL = "&"
 
static final String START_OF_NUMERAL = "&#"
 
static final String END_OF_MARK = ";"
 
static final ArrayList< String > AMP_LIST = new ArrayList<String>(Arrays.asList("&",START_OF_TEXTUAL + "amp" + END_OF_MARK,START_OF_NUMERAL + "38" + END_OF_MARK))
 
static final ArrayList< String > APOS_LIST = new ArrayList<String>(Arrays.asList("'",START_OF_TEXTUAL + "apos" + END_OF_MARK,START_OF_NUMERAL + "39" + END_OF_MARK))
 
static final ArrayList< String > QUOT_LIST = new ArrayList<String>(Arrays.asList("\"",START_OF_TEXTUAL + "quot" + END_OF_MARK,START_OF_NUMERAL + "34" + END_OF_MARK))
 
static final ArrayList< String > GT_LIST = new ArrayList<String>(Arrays.asList(">",START_OF_TEXTUAL + "gt" + END_OF_MARK,START_OF_NUMERAL + "62" + END_OF_MARK))
 
static final ArrayList< String > LT_LIST = new ArrayList<String>(Arrays.asList("<",START_OF_TEXTUAL + "lt" + END_OF_MARK,START_OF_NUMERAL + "60" + END_OF_MARK))
 
static final ArrayList
< ArrayList< String > > 
RESERVED_HTML_CHARS = new ArrayList<ArrayList<String>>()
 

Package Functions

RESERVED_HTML_CHARS. add (APOS_LIST)
 
RESERVED_HTML_CHARS. add (QUOT_LIST)
 
RESERVED_HTML_CHARS. add (GT_LIST)
 
RESERVED_HTML_CHARS. add (LT_LIST)
 

Static Package Attributes

 static
 

Static Private Member Functions

static boolean isSpecial (String source)
 

Detailed Description

Utility class (manipulates RFC 3339 dates)

Utility class (manipulates RFC 3339 dates and contains other utility methods)

Author
idytrych

Definition at line 29 of file Util.java.

Member Function Documentation

RESERVED_HTML_CHARS. cz.vutbr.fit.knot.annotations.comet.Util.add ( APOS_LIST  )
package
RESERVED_HTML_CHARS. cz.vutbr.fit.knot.annotations.comet.Util.add ( QUOT_LIST  )
package
RESERVED_HTML_CHARS. cz.vutbr.fit.knot.annotations.comet.Util.add ( GT_LIST  )
package
RESERVED_HTML_CHARS. cz.vutbr.fit.knot.annotations.comet.Util.add ( LT_LIST  )
package
static String cz.vutbr.fit.knot.annotations.comet.Util.escapeForXml ( String  str)
static

Escapes string for use in XML (replaces <,>,&,",')

Parameters
strString to escape
Returns
Escaped string

Definition at line 380 of file Util.java.

Here is the caller graph for this function:

static boolean cz.vutbr.fit.knot.annotations.comet.Util.isSpecial ( String  source)
staticprivate

The method seeks a special character in a string and evaluates whether it is a character entity.

Parameters
sourcetested string
Returns
true if it is character entity

Definition at line 414 of file Util.java.

Here is the caller graph for this function:

static int cz.vutbr.fit.knot.annotations.comet.Util.levenshtein ( String  s,
String  t 
)
static

Compute Levenshtein distance Adapted from http://www.merriampark.com/ld.htm

Author
Michael Gilleland (megilleland at yahoo.com)
Parameters
sString s
tString t
Returns
Returns Levenshtein distance of strings s and t

Definition at line 307 of file Util.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static int cz.vutbr.fit.knot.annotations.comet.Util.minimum ( int  a,
int  b,
int  c 
)
static

Gets minimum of three values

Parameters
aValue 1
bValue 2
cValue 3
Returns
Returns minimum of three values

Definition at line 294 of file Util.java.

Here is the caller graph for this function:

static java.util.Date cz.vutbr.fit.knot.annotations.comet.Util.parseDate ( String  datestring) throws java.text.ParseException, IndexOutOfBoundsException
static

Parse date in format according to RFC 3339 (date only, without time)

Author
idytrych
Parameters
datestringDate in string
Returns
Returns parsed date

Definition at line 131 of file Util.java.

static java.util.Date cz.vutbr.fit.knot.annotations.comet.Util.parseRFC3339Date ( String  datestring) throws java.text.ParseException, IndexOutOfBoundsException
static

Parse date in format according to RFC 3339

Author
Chad Okere (ceothrow1 at gmail dotcom)
idytrych
Parameters
datestringDate in string
Returns
Returns parsed date

Definition at line 86 of file Util.java.

static java.util.Date cz.vutbr.fit.knot.annotations.comet.Util.parseTime ( String  datestring) throws java.text.ParseException, IndexOutOfBoundsException
static

Parse time in format according to RFC 3339

Author
idytrych
Parameters
datestringTime in string
Returns
Returns parsed time (with some date)

Definition at line 164 of file Util.java.

static String cz.vutbr.fit.knot.annotations.comet.Util.parseTimeZoneID ( String  date)
static

Parses the timezone from the end of the String

Parameters
dateString with date and timezone on the end of it.
Returns
Timezone string or null

Definition at line 394 of file Util.java.

static String cz.vutbr.fit.knot.annotations.comet.Util.toHTMLString ( String  source)
static

The method converts an ordinary string to XML string.

Parameters
sourceordinary string
Returns
converted XML string

Definition at line 460 of file Util.java.

Here is the call graph for this function:

Here is the caller graph for this function:

static String cz.vutbr.fit.knot.annotations.comet.Util.toRFC3339Date ( Date  date)
static

Converts date to string in format according to RFC 3339

Parameters
dateDate to be converted
Returns
String with date in format according to RFC 3339

Definition at line 208 of file Util.java.

Here is the caller graph for this function:

static String cz.vutbr.fit.knot.annotations.comet.Util.toRFC3339DateOnly ( Date  date)
static

Converts date to string in format according to RFC 3339 (date only, without time)

Parameters
dateDate to be converted
Returns
String with date in format according to RFC 3339 (without time)

Definition at line 225 of file Util.java.

static String cz.vutbr.fit.knot.annotations.comet.Util.toRFC3339DateOnlyWTZ ( Date  date)
static

Converts date to string in format according to RFC 3339 (date only, without time, without time zone)

Parameters
dateDate to be converted
Returns
String with date in format according to RFC 3339 (without time and time zone)

Definition at line 252 of file Util.java.

static String cz.vutbr.fit.knot.annotations.comet.Util.toRFC3339Time ( Date  date)
static

Converts time to string in format according to RFC 3339

Parameters
dateDate with time to be converted
Returns
String with time in format according to RFC 3339

Definition at line 274 of file Util.java.

Member Data Documentation

final ArrayList<String> cz.vutbr.fit.knot.annotations.comet.Util.AMP_LIST = new ArrayList<String>(Arrays.asList("&",START_OF_TEXTUAL + "amp" + END_OF_MARK,START_OF_NUMERAL + "38" + END_OF_MARK))
static

Definition at line 64 of file Util.java.

final ArrayList<String> cz.vutbr.fit.knot.annotations.comet.Util.APOS_LIST = new ArrayList<String>(Arrays.asList("'",START_OF_TEXTUAL + "apos" + END_OF_MARK,START_OF_NUMERAL + "39" + END_OF_MARK))
static

Definition at line 65 of file Util.java.

final String cz.vutbr.fit.knot.annotations.comet.Util.END_OF_MARK = ";"
static

Definition at line 62 of file Util.java.

final ArrayList<String> cz.vutbr.fit.knot.annotations.comet.Util.GT_LIST = new ArrayList<String>(Arrays.asList(">",START_OF_TEXTUAL + "gt" + END_OF_MARK,START_OF_NUMERAL + "62" + END_OF_MARK))
static

Definition at line 67 of file Util.java.

final ArrayList<String> cz.vutbr.fit.knot.annotations.comet.Util.LT_LIST = new ArrayList<String>(Arrays.asList("<",START_OF_TEXTUAL + "lt" + END_OF_MARK,START_OF_NUMERAL + "60" + END_OF_MARK))
static

Definition at line 68 of file Util.java.

final int cz.vutbr.fit.knot.annotations.comet.Util.NUMERAL_CHARS = 2
static

Definition at line 56 of file Util.java.

final int cz.vutbr.fit.knot.annotations.comet.Util.NUMERAL_MAX_SIZE = 4
static

Definition at line 58 of file Util.java.

final ArrayList<String> cz.vutbr.fit.knot.annotations.comet.Util.QUOT_LIST = new ArrayList<String>(Arrays.asList("\"",START_OF_TEXTUAL + "quot" + END_OF_MARK,START_OF_NUMERAL + "34" + END_OF_MARK))
static

Definition at line 66 of file Util.java.

final int cz.vutbr.fit.knot.annotations.comet.Util.RESERVED_CHARS = 0
static

Definition at line 54 of file Util.java.

final ArrayList<ArrayList<String> > cz.vutbr.fit.knot.annotations.comet.Util.RESERVED_HTML_CHARS = new ArrayList<ArrayList<String>>()
static

Definition at line 70 of file Util.java.

final String cz.vutbr.fit.knot.annotations.comet.Util.START_OF_NUMERAL = "&#"
static

Definition at line 61 of file Util.java.

final String cz.vutbr.fit.knot.annotations.comet.Util.START_OF_TEXTUAL = "&"
static

Definition at line 60 of file Util.java.

cz.vutbr.fit.knot.annotations.comet.Util.static
staticpackage
Initial value:
{
RESERVED_HTML_CHARS.add(AMP_LIST)

Definition at line 71 of file Util.java.

final int cz.vutbr.fit.knot.annotations.comet.Util.TEXTUAL_CHARS = 1
static

Definition at line 55 of file Util.java.

final int cz.vutbr.fit.knot.annotations.comet.Util.TEXTUAL_MAX_SIZE = 8
static

Definition at line 57 of file Util.java.


The documentation for this class was generated from the following file: