Business Objects
Quark Platform Documentation
Version 1.7.1_0
Business Objects

org.openquark.cal.module.Cal.Core
Class CAL_Bits.Functions

java.lang.Object
  extended by org.openquark.cal.module.Cal.Core.CAL_Bits.Functions
Enclosing class:
CAL_Bits

public static final class CAL_Bits.Functions
extends Object

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


Field Summary
static QualifiedName bitwiseAnd
          Name binding for function: bitwiseAnd.
static QualifiedName bitwiseOr
          Name binding for function: bitwiseOr.
static QualifiedName bitwiseXor
          Name binding for function: bitwiseXor.
static QualifiedName complement
          Name binding for function: complement.
static QualifiedName highestBitMask
          Name binding for function: highestBitMask.
static QualifiedName shiftL
          Name binding for function: shiftL.
static QualifiedName shiftR
          Name binding for function: shiftR.
static QualifiedName shiftRUnsigned
          Name binding for function: shiftRUnsigned.
 
Constructor Summary
CAL_Bits.Functions()
           
 
Method Summary
static SourceModel.Expr bitwiseAnd(SourceModel.Expr x, SourceModel.Expr y)
          Combines its two arguments by performing a boolean AND operation on their individual bits.
static SourceModel.Expr bitwiseOr(SourceModel.Expr x, SourceModel.Expr y)
          Combines its two arguments by performing a boolean OR operation on their individual bits.
static SourceModel.Expr bitwiseXor(SourceModel.Expr x, SourceModel.Expr y)
          Combines its two arguments by performing a boolean XOR operation on their individual bits.
static SourceModel.Expr complement(SourceModel.Expr x)
          Inverts each bit of its input, converting ones to zeros and zeros to ones.
static SourceModel.Expr highestBitMask(SourceModel.Expr x)
          Clears all but the highest 1-bit of the input.
static SourceModel.Expr shiftL(SourceModel.Expr x, SourceModel.Expr numPlaces)
          Shifts the bits of the first argument left by the number of places specified by the second argument.
static SourceModel.Expr shiftR(SourceModel.Expr x, SourceModel.Expr numPlaces)
          Shifts the bits of the first argument to the right by the number of places specified by the second argument.
static SourceModel.Expr shiftRUnsigned(SourceModel.Expr x, SourceModel.Expr numPlaces)
          Works like Cal.Core.Bits.shiftR, but always shifts zeros into the high-order bits of the result, regardless of the sign of the first argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bitwiseAnd

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

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

bitwiseOr

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

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

bitwiseXor

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

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

complement

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

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

highestBitMask

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

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

shiftL

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

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

shiftR

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

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

shiftRUnsigned

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

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

CAL_Bits.Functions

public CAL_Bits.Functions()
Method Detail

bitwiseAnd

public static final SourceModel.Expr bitwiseAnd(SourceModel.Expr x,
                                                SourceModel.Expr y)
Combines its two arguments by performing a boolean AND operation on their individual bits. The results has a bit set only if the corresponding bit is set in both arguments. For example, bitwiseAnd(00001010, 00000111) => 00000010

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the first value to be bitwise ANDed.
y - (CAL type: Cal.Core.Bits.Bits a => a) the second value to be bitwise ANDed.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) the bitwise AND of x and y.

bitwiseOr

public static final SourceModel.Expr bitwiseOr(SourceModel.Expr x,
                                               SourceModel.Expr y)
Combines its two arguments by performing a boolean OR operation on their individual bits. The result has a bit set if the corresponding bit is set in either or both of the arguments. It has a zero bit only where both corresponding argument bits are zero. For example, bitwiseOr(00001010, 00000111) => 00001111

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the first value to be bitwise ORed.
y - (CAL type: Cal.Core.Bits.Bits a => a) the second value to be bitwise ORed.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) the bitwise OR of x and y.

bitwiseXor

public static final SourceModel.Expr bitwiseXor(SourceModel.Expr x,
                                                SourceModel.Expr y)
Combines its two arguments by performing a boolean XOR operation on their individual bits. The result has a bit set if the corresponding bits in the two arguments are different. If the corresponding argument bits are both ones or both zeros, the result bit is a zero. For example, bitwiseXor (00001010, 00000111) => 00001101

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the first value to be bitwise XORed.
y - (CAL type: Cal.Core.Bits.Bits a => a) the second value to be bitwise XORed.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) the bitwise XOR of x and y.

complement

public static final SourceModel.Expr complement(SourceModel.Expr x)
Inverts each bit of its input, converting ones to zeros and zeros to ones. For example, complement(00001100) => 11110011

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the value to be complemented bitwise.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) the bitwise complement of x.

highestBitMask

public static final SourceModel.Expr highestBitMask(SourceModel.Expr x)
Clears all but the highest 1-bit of the input. For example,

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the value whose bits except for its highest 1-bit is to be cleared.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) a value whose bits are all zero except for the bit corresponding to x's highest 1-bit.

shiftL

public static final SourceModel.Expr shiftL(SourceModel.Expr x,
                                            SourceModel.Expr numPlaces)
Shifts the bits of the first argument left by the number of places specified by the second argument. High-order bits of the first argument are lost, and zero bits are shifted in from the right. For example,

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the value to be left-shifted.
numPlaces - (CAL type: Cal.Core.Bits.Bits a => a) the number of places by which x is left-shifted.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) x left-shifted by numPlaces places.

shiftR

public static final SourceModel.Expr shiftR(SourceModel.Expr x,
                                            SourceModel.Expr numPlaces)
Shifts the bits of the first argument to the right by the number of places specified by the second argument. The low-order bits of the first argument are shifted away and are lost. The high-order bits shifted in are the same as the original high-order bits of the first argument. In other words, if the first argument is positive, zeros are shifted into the high-order bits. If the first argument is negative, ones are shifted in instead. For example,

See Also:
Functions and Class Methods: Cal.Core.Bits.shiftRUnsigned

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the value to be right-shifted.
numPlaces - (CAL type: Cal.Core.Bits.Bits a => a) the number of places by which x is right-shifted.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) x right-shifted by numPlaces places.

shiftRUnsigned

public static final SourceModel.Expr shiftRUnsigned(SourceModel.Expr x,
                                                    SourceModel.Expr numPlaces)
Works like Cal.Core.Bits.shiftR, but always shifts zeros into the high-order bits of the result, regardless of the sign of the first argument. For example, shiftRUnsigned(11111111, 4) => 00001111
See Also:
Functions and Class Methods: Cal.Core.Bits.shiftR

Parameters:
x - (CAL type: Cal.Core.Bits.Bits a => a) the value to be right-shifted.
numPlaces - (CAL type: Cal.Core.Bits.Bits a => a) the number of places by which x is right-shifted.
Returns:
(CAL type: Cal.Core.Bits.Bits a => a) x right-shifted by numPlaces places.

Business Objects
Quark Platform Documentation
Version 1.7.1_0
Business Objects

Copyright © 2007 Business Objects. All rights reserved.