Interface
caplin.core.log

LogStoreService

Constructor Summary

Attributes Name and Description
caplin.core.log.LogStoreService()

This represents an interface, and should not normally be constructed.

Method Summary

Attributes Name and Description
Number addListener(function callback)

Adds a listener the that will be notified if the stored contents changes.

void clear()

Clears all stored log records.

Array getAllLogRecords()

Retrieves all stored log records.

caplin.core.log.LogRecord getLogRecord(Number n)

Retrieves a stored log record.

Number getSize()

void removeListener(Number id)

Adds a listener the that will be notified if the stored contents changes.

Constructor Detail

caplin.core.log.LogStoreService()

This represents an interface, and should not normally be constructed.

Method Detail

Number addListener(function callback)

Adds a listener the that will be notified if the stored contents changes.

Parameters
function callback The function that will be called on any changes.
Returns
An id for the listener that can be used to remove it (see caplin.core.log.LogStoreService.prototype.removeListener).

void clear()

Clears all stored log records.

Array getAllLogRecords()

Retrieves all stored log records.

Returns
a caplin.core.log.LogRecord. Will not be null.

caplin.core.log.LogRecord getLogRecord(Number n)

Retrieves a stored log record.

Parameters
Number n the index of the log record to be retreived.
Returns
the nth oldest LogRecord (0 indexed) or undefined if n refers to a log record that hasn't been stored.

Number getSize()

Returns
The number of stored log records.

void removeListener(Number id)

Adds a listener the that will be notified if the stored contents changes.

Parameters
Number id The id of the listener to be removed (see caplin.core.log.LogStoreService.prototype.addListener).