Solstice::PositionService - Queueing and positioning info for collections of objects.


Solstice documentation  | view source Contained in the Solstice distribution.

Index


NAME

Top

Solstice::PositionService - Queueing and positioning info for collections of objects.

SYNOPSIS

Top

    use Solstice::PositionService;
    my $position_service = new Solstice::PositionService;

    # get zero-indexed position in queue
    my $position = $position_service->enqueue();

    #am I the last one?
    if ( $position == ($position_service->getQueueSize() - 1)){
        ...
    }

DESCRIPTION

Top

Superclass

Solstice::Service

Export

No symbols exported.

Methods

initialize($id, $value)

Sets the position value for the passed $id to $value, or 0 if $value is undefined. Returns undef.

enqueue([$id])

Increment the position value for the passed $id. If the value is not defined, it is initialized as 0. Returns the current position value.

reset([$id])

Sets the position value for the passed $id to 0. Returns undef.

getQueueSize([$id])

Returns the current position value for the passed $id, or 0 if not defined.

Private Methods

_getClassName()

Return the class name. Overridden to avoid a ref() in the superclass.

Modules Used

Solstice::Service.

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 3364 $

COPYRIGHT

Top


Solstice documentation  | view source Contained in the Solstice distribution.