BitField source

Compactly stores multiple values as a short series of bits.

Specializes Montage

The BitField object compactly stores multiple values as a short series of bits. This implementation is limited to 32 fields.

Properties

delegate :Property <constructor> source

The BitField object's delegate.

Default Value:
  • null

value :Function <constructor> source

Default Value:
  • {number} 0

Methods

addField(aFieldName, defaultValue) <constructor> source

Adds a new field to a BitField instance.

Parameters:
Name Type Description
aFieldName string

The name of the field to add.

defaultValue Mixed

The new field's default value.

callDelegateMethod() <constructor> source

Returns:

Nothing

initWithDescriptor(propertyDescriptor) → {Object} <constructor> source

Creates a new BitField object containing the fields provided in the propertyDescriptor parameter.

Parameters:
Name Type Description
propertyDescriptor Object

An object containing one or more property name/value pairs. Each pair is added to the new BitField.

Returns: Object

A new BitField object that contains fields described by the property descriptor.

Example
var bitField = new BitField();
bitField = new BitField().initWithDescriptor({
    likes_golf: {
        value: false
    },
    likes_basketball: {
        value: true
    },
    likes_baseball: {
        value: false
    },
});

removeField(aFieldName) <constructor> source

Removes a field from the bitfield.

Parameters:
Name Type Description
aFieldName string

The name of the field to remove.

reset() <constructor> source

toString() <constructor> source

Returns:

result

callDelegateMethod(name) source

This method calls the method named with the identifier prefix if it exists. Example: If the name parameter is "shouldDoSomething" and the caller's identifier is "bob", then this method will try and call "bobShouldDoSomething"

Parameters:
Name Type Description
name string
Inherited From:

equals(anObject) → {boolean} source

Returns true if two objects are equal, otherwise returns false.

Parameters:
Name Type Description
anObject Object

The object to compare for equality.

Inherited From:
Returns: boolean

Returns true if the calling object and anObject are identical and their uuid properties are also equal. Otherwise, returns false.

Generated from a4679af

comments powered by Disqus

More help?

Can't find what you are looking for? Get in touch, we're more than happy in helping answer your questions.