Overview | File | Class | Tree | Index | Help
| Jala 1.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class jala.Utilities

    Object
       |
       +--jala.Utilities

class jala.Utilities

This class contains various convenience methods which do not fit in any other class.
Defined in Utilities.js

Field Summary
`<static> <final> Number` | `VALUE_ADDED` Static field indicating ad added object property.
`<static> <final> Number` | `VALUE_MODIFIED` Static field indicating a modified object property.
`<static> <final> Number` | `VALUE_REMOVED` Static field indicating a removed object property.

Constructor Summary
`jala.Utilities ()` Construct a utility object.

Method Summary
`String` | `createPassword(<Number> len, <Number> level)` Creates a random password with different levels of security.
`Object` | `diffObjects(<Object> obj1, <Object> obj2)` Returns an array containing the properties that are added, removed or modified in one object compared to another.
`Object` | `patchObject(<Object> obj, <Object> diff)` Patches an object with a "diff" object created by the diffObjects() method.
`String` | `toString()` Return a string representation of the utitility object.

Field Detail

### VALUE_ADDED

    <static> <final> Number VALUE_ADDED

Static field indicating ad added object property.

See Also:
  Constant Field Values

### VALUE_MODIFIED

    <static> <final> Number VALUE_MODIFIED

Static field indicating a modified object property.

See Also:
  Constant Field Values

### VALUE_REMOVED

    <static> <final> Number VALUE_REMOVED

Static field indicating a removed object property.

See Also:
  Constant Field Values

Constructor Detail

### jala.Utilities

    jala.Utilities()

Construct a utility object.

Returns:

A new utitilty object.

Method Detail

### createPassword

    String createPassword(<Number> len, <Number> level)

Creates a random password with different levels of security.

Parameters:

`len` - The length of the password (default: 8)

`level` - The security level

- 0 - containing only vowels or consonants (default)
- 1 - throws in a number at random position
- 2 - throws in a number and a special character at random position

Returns:

The resulting password

### diffObjects

    Object diffObjects(<Object> obj1, <Object> obj2)

Returns an array containing the properties that are added, removed or modified in one object compared to another.

Parameters:

`obj1` - The first of two objects which should be compared

`obj2` - The second of two objects which should be compared

Returns:

An Object containing all properties that are added, removed or modified in the second object compared to the first. Each property contains a status field with an integer value which can be checked against the static jala.Utility fields VALUE_ADDED, VALUE_MODIFIED and VALUE_REMOVED.

### patchObject

    Object patchObject(<Object> obj, <Object> diff)

Patches an object with a "diff" object created by the diffObjects() method. Please mind that this method is recursive, it descends along the "diff" object structure.

Parameters:

`obj` - The Object the diff should be applied to

`diff` - A "diff" object created by the diffObjects() method

Returns:

The patched Object with all differences applied

### toString

    String toString()

Return a string representation of the utitility object.

Returns:

[jala.Utilities Object]

Overview | File | Class | Tree | Index | Help
| Jala 1.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Tue May 29 10:26:15 2007