VR-Link JAVA API Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
List of all members | Static Public Member Functions
com.mak.vrlj.vl.BitUtil Class Reference

A collection of simple utilities for manipulating bitfields. More...

Static Public Member Functions

static int getBitField (int value, int offset, int len)
 Return the numeric value of a subset of bits.
static long getBitField (long value, int offset, int len)
 Return the numeric value of a subset of bits.
static int setBitField (int value, int offset, int len, int newVal)
 Set the numeric value of a subset of bits.
static long setBitField (long value, int offset, int len, long newVal)
 Set the numeric value of a subset of bits.

Detailed Description

A collection of simple utilities for manipulating bitfields.

Member Function Documentation

static int com.mak.vrlj.vl.BitUtil.getBitField ( int  value,
int  offset,
int  len 
)
inlinestatic

Return the numeric value of a subset of bits.

Parameters
valuethe original value containing the bitfield.
offsetthe offset of the least valued bit (e.g. 0 = bitfield starts with bit 0).
lenthe number of bits to use.
Returns
the value of the bitfield.

Referenced by com.mak.vrlj.object.Entity.getAppearanceBitField().

static long com.mak.vrlj.vl.BitUtil.getBitField ( long  value,
int  offset,
int  len 
)
inlinestatic

Return the numeric value of a subset of bits.

Parameters
valuethe original value containing the bitfield.
offsetthe offset of the least valued bit (e.g. 0 = bitfield starts with bit 0).
lenthe number of bits to use.
Returns
the value of the bitfield.
static int com.mak.vrlj.vl.BitUtil.setBitField ( int  value,
int  offset,
int  len,
int  newVal 
)
inlinestatic

Set the numeric value of a subset of bits.

Parameters
valuethe original value containing the bitfield.
offsetthe offset of the least valued bit (e.g. 0 = bitfield starts with bit 0).
lenthe number of bits to use.
newValthe new value for the bitfield.
Returns
the original value with the bitfield bits overwritten with the new value newVal.

Referenced by com.mak.vrlj.object.Entity.setAppearanceBitField().

static long com.mak.vrlj.vl.BitUtil.setBitField ( long  value,
int  offset,
int  len,
long  newVal 
)
inlinestatic

Set the numeric value of a subset of bits.

Parameters
valuethe original value containing the bitfield.
offsetthe offset of the least valued bit (e.g. 0 = bitfield starts with bit 0).
lenthe number of bits to use.
newValthe new value for the bitfield.
Returns
the original value with the bitfield bits overwritten with the new value newVal.

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Apr 8 04:49:21 EDT 2019 from SVN revision 197403
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)