NVelocity.App.Tools
Class VelocityFormatter

Constructor Summary
VelocityFormatter(NVelocity.Context.IContext context)
         Constructor needs a backpointer to the context. *

Method Summary
string formatArray(object array, string delim, string finaldelim)
         Formats an array into the form "A<delim>B<finaldelim>C". *
string formatArray(object array, string delim)
         Formats an array into the form "A<delim>B<delim>C". *
string formatArray(object array)
         Formats an array into the form "A, B and C". *
string formatLongDate(System.DateTime date)
         Formats a date in 'long' style. *
string formatLongDateTime(System.DateTime date)
         Formats a date/time in 'long' style. *
string formatShortDate(System.DateTime date)
         Formats a date in 'short' style. *
string formatShortDateTime(System.DateTime date)
         Formats a date/time in 'short' style. *
string formatVector(System.Collections.ArrayList vector, string delim, string finaldelim)
         Formats a vector into the form "Adelim>B<finaldelim>C". *
string formatVector(System.Collections.ArrayList vector, string delim)
         Formats a vector into the form "A<delim>B<delim>C". *
string formatVector(System.Collections.ArrayList vector)
         Formats a vector into the form "A, B and C". *
object isNull(object o, object dflt)
         Returns a default value if the object passed is null.
string limitLen(int maxlen, string string_Renamed, string suffix)
         Limits 'string' to 'maxlen' character. If the string gets curtailed, 'suffix' is appended to it. *
string limitLen(int maxlen, string string_Renamed)
         Limits 'string' to 'maxlen' characters. If the string gets curtailed, "..." is appended to it. *
string makeAlternator(string name, string alt1, string alt2, string alt3, string alt4)
         Makes an alternator object that alternates between four values. *
string makeAlternator(string name, string alt1, string alt2, string alt3)
         Makes an alternator object that alternates between three values. *
string makeAlternator(string name, string alt1, string alt2)
string makeAutoAlternator(string name, string alt1, string alt2)
         Makes an alternator object that alternates between two values automatically. *

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString


Constructor Detail

VelocityFormatter

public VelocityFormatter(NVelocity.Context.IContext context)

Constructor needs a backpointer to the context. *

Parameters:
context - A Context.
Method Detail

formatArray

public string formatArray(object array,
                          string delim,
                          string finaldelim)

Formats an array into the form "A<delim>B<finaldelim>C". *

Parameters:
array - An Object.
delim - A String.
finalDelim - A String.
Returns:
A String.

formatArray

public string formatArray(object array,
                          string delim)

Formats an array into the form "A<delim>B<delim>C". *

Parameters:
array - An Object.
delim - A String.
Returns:
A String.

formatArray

public string formatArray(object array)

Formats an array into the form "A, B and C". *

Parameters:
array - An Object.
Returns:
A String.

formatLongDate

public string formatLongDate(System.DateTime date)

Formats a date in 'long' style. *

Parameters:
date - A Date.
Returns:
A String.

formatLongDateTime

public string formatLongDateTime(System.DateTime date)

Formats a date/time in 'long' style. *

Parameters:
date - A Date.
Returns:
A String.

formatShortDate

public string formatShortDate(System.DateTime date)

Formats a date in 'short' style. *

Parameters:
date - A Date.
Returns:
A String.

formatShortDateTime

public string formatShortDateTime(System.DateTime date)

Formats a date/time in 'short' style. *

Parameters:
date - A Date.
Returns:
A String.

formatVector

public string formatVector(System.Collections.ArrayList vector,
                           string delim,
                           string finaldelim)

Formats a vector into the form "Adelim>B<finaldelim>C". *

Parameters:
vector - A Vector.
delim - A String.
finalDelim - A String.
Returns:
A String.

formatVector

public string formatVector(System.Collections.ArrayList vector,
                           string delim)

Formats a vector into the form "A<delim>B<delim>C". *

Parameters:
vector - A Vector.
delim - A String.
Returns:
A String.

formatVector

public string formatVector(System.Collections.ArrayList vector)

Formats a vector into the form "A, B and C". *

Parameters:
vector - A Vector.
Returns:
A String.

isNull

public object isNull(object o,
                     object dflt)

Returns a default value if the object passed is null.


limitLen

public string limitLen(int maxlen,
                       string string_Renamed,
                       string suffix)

Limits 'string' to 'maxlen' character. If the string gets curtailed, 'suffix' is appended to it. *

Parameters:
maxlen - An int with the maximum length.
string - A String.
suffix - A String.
Returns:
A String.

limitLen

public string limitLen(int maxlen,
                       string string_Renamed)

Limits 'string' to 'maxlen' characters. If the string gets curtailed, "..." is appended to it. *

Parameters:
maxlen - An int with the maximum length.
string - A String.
Returns:
A String.

makeAlternator

public string makeAlternator(string name,
                             string alt1,
                             string alt2,
                             string alt3,
                             string alt4)

Makes an alternator object that alternates between four values. *


makeAlternator

public string makeAlternator(string name,
                             string alt1,
                             string alt2,
                             string alt3)

Makes an alternator object that alternates between three values. *


makeAlternator

public string makeAlternator(string name,
                             string alt1,
                             string alt2)


makeAutoAlternator

public string makeAutoAlternator(string name,
                                 string alt1,
                                 string alt2)

Makes an alternator object that alternates between two values automatically. *