Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

org.openquark.cal.module.Cal.Experimental.Concurrent
Class CAL_BlockingQueue.Functions

java.lang.Object
  extended by org.openquark.cal.module.Cal.Experimental.Concurrent.CAL_BlockingQueue.Functions
Enclosing class:
CAL_BlockingQueue

public static final class CAL_BlockingQueue.Functions
extends Object

This inner class (Functions) contains constants and methods related to binding to CAL functions in the Cal.Experimental.Concurrent.BlockingQueue module.


Field Summary
static QualifiedName makeBlockingQueue
          Name binding for function: makeBlockingQueue.
static QualifiedName put
          Name binding for function: put.
static QualifiedName take
          Name binding for function: take.
 
Constructor Summary
CAL_BlockingQueue.Functions()
           
 
Method Summary
static SourceModel.Expr makeBlockingQueue(int maxSize)
           
static SourceModel.Expr makeBlockingQueue(SourceModel.Expr maxSize)
          This creates a blocking queue that can hold at most size elements.
static SourceModel.Expr put(SourceModel.Expr queue, SourceModel.Expr item)
          Put an element on the queue.
static SourceModel.Expr take(SourceModel.Expr queue)
          Takes an item from a queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

makeBlockingQueue

public static final QualifiedName makeBlockingQueue
Name binding for function: makeBlockingQueue.

See Also:
makeBlockingQueue(org.openquark.cal.compiler.SourceModel.Expr)

put

public static final QualifiedName put
Name binding for function: put.

See Also:
put(org.openquark.cal.compiler.SourceModel.Expr, org.openquark.cal.compiler.SourceModel.Expr)

take

public static final QualifiedName take
Name binding for function: take.

See Also:
take(org.openquark.cal.compiler.SourceModel.Expr)
Constructor Detail

CAL_BlockingQueue.Functions

public CAL_BlockingQueue.Functions()
Method Detail

makeBlockingQueue

public static final SourceModel.Expr makeBlockingQueue(SourceModel.Expr maxSize)
This creates a blocking queue that can hold at most size elements. If you attempt to put elements into the queue when it is full the put will block.

Parameters:
maxSize - (CAL type: Cal.Core.Prelude.Int) the maximum size of the queue
Returns:
(CAL type: Cal.Experimental.Concurrent.BlockingQueue.BlockingQueue a)

makeBlockingQueue

public static final SourceModel.Expr makeBlockingQueue(int maxSize)
Parameters:
maxSize -
Returns:
the SourceModel.Expr representing an application of makeBlockingQueue
See Also:
makeBlockingQueue(org.openquark.cal.compiler.SourceModel.Expr)

put

public static final SourceModel.Expr put(SourceModel.Expr queue,
                                         SourceModel.Expr item)
Put an element on the queue. If the queue already contains size elements this function will block until another thread removes an item from the queue

Parameters:
queue - (CAL type: Cal.Experimental.Concurrent.BlockingQueue.BlockingQueue a) the queue to add to
item - (CAL type: a) the item to add
Returns:
(CAL type: ())

take

public static final SourceModel.Expr take(SourceModel.Expr queue)
Takes an item from a queue. If the queue is empty this function will block until an item is inserted by another thread.

Parameters:
queue - (CAL type: Cal.Experimental.Concurrent.BlockingQueue.BlockingQueue a) the queue to take an item from.
Returns:
(CAL type: a)

Business Objects
Quark Platform Documentation
Version 1.7.0_0
Business Objects

Copyright © 2007 Business Objects. All rights reserved.