1 Line

Class Ax.text.Line


A line formatter using columns for ASCII columnar data generation.

Constructor Summary

Method
Description
JSLine(int size)
Creates a new line formatter instance with the defined line size.
JSLine(int size, char fill)
Creates a new line formatter instance with the defined line size/length and line filler.

Method Summary

Modifier and Type
Method
Description
Ax.text.Line 
add(int cpos, Ax.text.String data)
Adds data to the line in the defined position.
Ax.text.String 
Returns the formatted line as a string.

Constructor Detail

Ax.text.Line.JSLine

Ax.text.Line.JSLine(
	smallint size
						)
Info:
Creates a new line formatter instance with the defined line size.
Parameters:
size - the line size

Example
Copy
var line = new Ax.text.Line(20)
                           .add(1, 'abc')
                           .add(2,'123')
                           .add(10, (function () { return "XYZ"; })() )
                           .toString();
     // [ a123     XYZ       ]

Ax.text.Line.JSLine

Ax.text.Line.JSLine(
	smallint size,
	object fill
						)
Info:
Creates a new line formatter instance with the defined line size/length and line filler. Line filler will be used to fill the line positions with that character, by default is ' '.
Parameters:
size - the line size
fill - the line positions filler

Example
Copy
var line = new Ax.text.Line(10, '@');
         // [@@@@@@@@@@]

Method Detail

Ax.text.Line.add

object Ax.text.Line.add(
	smallint cpos,
	string data
)
Info:
Adds data to the line in the defined position.
Parameters:
cpos - the position to add the data
data - the content to add
Returns:
object

Ax.text.Line.toString

string Ax.text.Line.toString()
Info:
Returns the formatted line as a string.
Returns:
string

2 DateFormat

Class Ax.text.DateFormat


Static class to format dates.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
Ax.text.String 
format(Number millis, Ax.text.String format)
Formats the date represented as milliseconds since January 1, 1970.
Ax.text.String 
format(Date date,Ax.text.String format)
Formats the given date.
Date 
parse(Ax.text.String source, Ax.text.String format)
Parses the given string and retrieves its date.

Constructor Detail

Ax.text.DateFormat.JSDateFormat

Ax.text.DateFormat.JSDateFormat()

Method Detail

Ax.text.DateFormat.format

string Ax.text.DateFormat.format(
	object millis,
	string format
)
Info:
Formats the date represented as milliseconds since January 1, 1970.
Parameters:
millis - the milliseconds representing the date
format - the format to use
Returns:
string

Ax.text.DateFormat.format

string Ax.text.DateFormat.format(
	date date,
	string format
)
Info:
Formats the given date.
Parameters:
date - the date to format
format - the format to use
Returns:
string

Example
Copy
console.log(Ax.text.Date.format(new Date().getTime(), "dd-mm-yyyy"));

Ax.text.DateFormat.parse

date Ax.text.DateFormat.parse(
	string source,
	string format
)
Info:
Parses the given string and retrieves its date.
Parameters:
source - the string to parse
format - the formatter used
Returns:
date

3 MessageFormat

Class Ax.text.MessageFormat


Static class to produce concatenated messages, formatting the necessary objects and inserting them in the appropriate place in the message.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
Ax.text.String 
format(Ax.text.String text, Object args)
Formats the given text, adding the given arguments to the appropriate places in the text.
Ax.text.String 
format(Ax.text.String text,Object[] args)
Formats the given text, adding the given arguments to the appropriate places in the text.

Constructor Detail

Ax.text.MessageFormat.JSMessageFormat

Ax.text.MessageFormat.JSMessageFormat()

Method Detail

Ax.text.MessageFormat.format

string Ax.text.MessageFormat.format(
	string text,
	object args
)
Info:
Formats the given text, adding the given arguments to the appropriate places in the text.
Parameters:
text - the source text
args - the arguments to format and add
Returns:
string

Ax.text.MessageFormat.format

string Ax.text.MessageFormat.format(
	string text,
	object[] args
)
Info:
Formats the given text, adding the given arguments to the appropriate places in the text.
Parameters:
text - the source text
args - the arguments to format and add
Returns:
string

Example
Copy
Ax.text.MessageFormat.format
     (
         'At {1,time} on {1,date}, there was {2} on planet {0,number,integer}',
         7,
         new Ax.sql.Date(2020,1,1, 12,30,30),
         'a disturbance in the Force'
     );
     // At 12:30:30 PM on Jan 1, 2020, there was a disturbance in the Force on planet 7

4 NumberFormat

Class Ax.text.NumberFormat


Class to format and parse numbers to any locale.

Constructor Summary

Method
Description
JSNumberFormat(Ax.text.String lang)
Creates a nw number formatter instance for the given language.

Method Summary

Modifier and Type
Method
Description
Ax.text.String 
format(short number, Ax.text.String format)
Formats the given short value.
Ax.text.String 
format(int number,Ax.text.String format)
Formats the given int value.
Ax.text.String 
format(float number, Ax.text.String format)
Formats the given float value.
Ax.text.String 
format(long number,Ax.text.String format)
Formats the given long value.
Ax.text.String 
format(double number, Ax.text.String format)
Formats the given double value.
Ax.text.String 
format(Ax.java.math.BigDecimal number,Ax.text.String format)
Formats the given BigDecimal value.
parse(Ax.text.String source, Ax.text.String format)
Parses the given string and retrieves its numeric value.

Constructor Detail

Ax.text.NumberFormat.JSNumberFormat

Ax.text.NumberFormat.JSNumberFormat(
	string lang
						)
Info:
Creates a nw number formatter instance for the given language.
Parameters:
lang - the language to get the locale

Method Detail

Ax.text.NumberFormat.format

string Ax.text.NumberFormat.format(
	object number,
	string format
)
Info:
Formats the given short value.
Parameters:
number - the number to format
format - the format to use
Returns:
string

Ax.text.NumberFormat.format

string Ax.text.NumberFormat.format(
	smallint number,
	string format
)
Info:
Formats the given int value.
Parameters:
number - the number to format
format - the format to use
Returns:
string

Ax.text.NumberFormat.format

string Ax.text.NumberFormat.format(
	object number,
	string format
)
Info:
Formats the given float value.
Parameters:
number - the number to format
format - the format to use
Returns:
string

Ax.text.NumberFormat.format

string Ax.text.NumberFormat.format(
	long number,
	string format
)
Info:
Formats the given long value.
Parameters:
number - the number to format
format - the format to use
Returns:
string

Ax.text.NumberFormat.format

string Ax.text.NumberFormat.format(
	double number,
	string format
)
Info:
Formats the given double value.
Parameters:
number - the number to format
format - the format to use
Returns:
string

Ax.text.NumberFormat.format

string Ax.text.NumberFormat.format(
	object number,
	string format
)
Info:
Formats the given BigDecimal value.
Parameters:
number - the number to format
format - the format to use
Returns:
string

Ax.text.NumberFormat.parse

object Ax.text.NumberFormat.parse(
	string source,
	string format
)
Info:
Parses the given string and retrieves its numeric value.
Parameters:
source - the string to parse
format - the format used
Returns:
object

5 DecimalFormat

DateFormat is an abstract class for date/time formatting subclasses which formats and parses dates or time in a language-independent manner.

DecimalFormat documentation page.

6 String

The String class represents character strings. All string literals in Java programs, such as "abc", are implemented as instances of this class.

String documentation page.