OverviewSingleDeprecated

package jsx3.util

Utility classes.

Class Summary
jsx3.util.Collection
Deprecated. Subsumed by jsx3.util.List.
jsx3.util.DateFormat
Formats and parses dates according to a token-based string format.
jsx3.util.EventDispatcher
An Event Dispatcher mixin interface, adds the ability to register event listeners and dispatch events to those listeners.
jsx3.util.Iterator
An interface that defines an object that can be iterated over.
jsx3.util.List
An object-oriented version of the built-in JavaScript Array class.
jsx3.util.Locale
Represents a region of the world.
jsx3.util.Logger
A Logger is used to log messages about a particular component of an application.
jsx3.util.Logger.AlertHandler
Handles a logging record by sending it to a JavaScript alert.
jsx3.util.Logger.FormatHandler
A subclass of Handler that includes functionality for formatting logging records as human-readable strings.
jsx3.util.Logger.Handler
The base logging handler class.
jsx3.util.Logger.Manager
Manager class for the logging system.
jsx3.util.Logger.MemoryHandler
A simple Handler class that stores a rotating cache of log records in memory.
jsx3.util.Logger.Record
Record bean that stores information about a logging message.
jsx3.util.MessageFormat
Constructs messages from a pattern and parameters.
jsx3.util.NumberFormat
Formats numbers.
Method Summary
static int
arrIndexOf(a : Array, o : Object)
Returns the array index of o in a.
static boolean
Returns v == null || isNaN(v).
static Number
numMod(v : Number, mod : Number)
Calculates a mod b, but the result is not allowed to be negative.
static Number
numRound(v : Number, intUnit : int)
Rounds v to the nearest value that can be divided by intUnit.
static String
Returns the result of decoding s from its base-64 equivalent.
static boolean
Returns whether s is null or an empty string.
static String
Returns the result of encoding s to its base-64 equivalent.
static boolean
strEndsWith(s : String, strTest : String)
Returns whether s ends with strTest.
static String
Returns s with the following four characters replaced by their escaped equivalent: & < > ".
static String
Returns s trimmed of trailing and leading spaces (anything matching the regexp /\s/).
static String
strTruncate(s : String, intMax : int, strEllipsis : String, fltPos : Number)
Limits s to length intMax by placing an ellipsis in values that are too long.
Method Detail

arrIndexOf

static int arrIndexOf(a : Array, o : Object)
Returns the array index of o in a. Comparisons are performed with strict equals (===).

Parameters:

a
o

Returns:

 

numIsNaN

static boolean numIsNaN(v : Object)
Returns v == null || isNaN(v).

Parameters:

vany value.

Returns:

 

Since:

3.2

numMod

static Number numMod(v : Number, mod : Number)
Calculates a mod b, but the result is not allowed to be negative.

Parameters:

va
modb

Returns:

a mod b if a >= 0, b + a mod b, if a < 0

Since:

3.2

numRound

static Number numRound(v : Number, intUnit : int)
Rounds v to the nearest value that can be divided by intUnit.

Parameters:

v
intUnit

Returns:

 

Since:

3.2

strDecodeBase64

static String strDecodeBase64(s : String)
Returns the result of decoding s from its base-64 equivalent.

Parameters:

s

Returns:

 

Since:

3.2

strEmpty

static boolean strEmpty(s : String)
Returns whether s is null or an empty string.

Parameters:

s

Returns:

 

Since:

3.2

strEncodeBase64

static String strEncodeBase64(s : String)
Returns the result of encoding s to its base-64 equivalent.

Parameters:

s

Returns:

 

Since:

3.2

strEndsWith

static boolean strEndsWith(s : String, strTest : String)
Returns whether s ends with strTest.

Parameters:

s
strTest

Returns:

 

Since:

3.2

strEscapeHTML

static String strEscapeHTML(s : String)
Returns s with the following four characters replaced by their escaped equivalent: & < > ". This method also replaces any character that is not a valid XML character (valid character codes are: 0x09, 0x0A, 0x0D, 0x20-0xD7FF, 0xE000-0xFFFD, 0x10000-0x10FFFF) with "\uXX" where XX is the unicode hex value of the character.

Parameters:

s

Returns:

 

Since:

3.2

strTrim

static String strTrim(s : String)
Returns s trimmed of trailing and leading spaces (anything matching the regexp /\s/).

Parameters:

s

Returns:

 

Since:

3.2

strTruncate

static String strTruncate(s : String, intMax : int, strEllipsis : String, fltPos : Number)
Limits s to length intMax by placing an ellipsis in values that are too long.

Parameters:

s
intMaxthe maximum length of the string returned by this method.
strEllipsisthe ellipsis to use. "..." is used by default.
fltPosthe placement of the ellipsis as a value between 0 and 1. 1, the default, means that the ellipsis comes at the end of the truncated string. Other values mean that the head and tail of the string will be returned with the ellipsis somewhere in the middle.

Returns:

 

Since:

3.2