Javolution 6.0.0 java
|
Public Member Functions | |
final Struct | struct () |
final int | offset () |
final int | bitIndex () |
final int | bitLength () |
Protected Member Functions | |
Member (int bitLength, int wordSize) | |
Package Functions | |
final int | get (int wordSize, int word) |
final int | set (int value, int wordSize, int word) |
final long | get (int wordSize, long word) |
final long | set (long value, int wordSize, long word) |
Private Attributes | |
final int | _offset |
final int | _bitIndex |
final int | _bitLength |
This inner class represents the base class for all Struct members. It allows applications to define additional member types. For example:[code] public class MyStruct extends Struct { BitSet bits = new BitSet(256); ... public BitSet extends Member { public BitSet(int nbrBits) { super(nbrBits, 0); // Direct bit access. } public boolean get(int i) { ... } public void set(int i, boolean value) { ...} } }[/code]
Definition at line 894 of file Struct.java.
|
protected |
Base constructor for custom member types.
The word size can be zero, in which case the offset of the member does not change, only bitIndex is incremented.
bitLength | the number of bits or 0 to force next member on next word boundary. |
wordSize | the word size in bytes used when accessing this member data or 0 if the data is accessed at the bit level. |
Definition at line 922 of file Struct.java.
References javolution.io.Struct._alignment, javolution.io.Struct.Member._bitIndex, javolution.io.Struct.Member._bitLength, javolution.io.Struct._bitsUsed, javolution.io.Struct._index, javolution.io.Struct._length, javolution.io.Struct.Member._offset, javolution.io.Struct._resetIndex, javolution.io.Struct._wordSize, javolution.io.Struct.Member.bitLength(), javolution.io.Struct.isPacked(), and javolution.lang.MathLib.max().
final int javolution.io.Struct.Member.bitIndex | ( | ) |
Holds the bit offset of this member (if any). The actual position of the bits data depends upon the endianess and the word size.
Definition at line 998 of file Struct.java.
References javolution.io.Struct.Member._bitIndex.
Referenced by javolution.io.Struct.Member.get(), javolution.io.Struct.BitField.longValue(), javolution.io.Struct.Member.set(), and javolution.io.Struct.BitField.set().
final int javolution.io.Struct.Member.bitLength | ( | ) |
Returns the number of bits in this member. Can be zero if this member is used to force the next member to the next word boundary.
Definition at line 1008 of file Struct.java.
References javolution.io.Struct.Member._bitLength.
Referenced by javolution.io.Struct.Member.get(), javolution.io.Struct.Bool.get(), javolution.io.Struct.Signed8.get(), javolution.io.Struct.Unsigned8.get(), javolution.io.Struct.Signed16.get(), javolution.io.Struct.Unsigned16.get(), javolution.io.Struct.Signed32.get(), javolution.io.Struct.Unsigned32.get(), javolution.io.Struct.Signed64.get(), javolution.io.Struct.BitField.longValue(), javolution.io.Struct.Member.Member(), javolution.io.Struct.Member.set(), javolution.io.Struct.Bool.set(), javolution.io.Struct.Signed8.set(), javolution.io.Struct.Unsigned8.set(), javolution.io.Struct.Signed16.set(), javolution.io.Struct.Unsigned16.set(), javolution.io.Struct.Signed32.set(), javolution.io.Struct.Unsigned32.set(), javolution.io.Struct.Signed64.set(), and javolution.io.Struct.BitField.set().
|
package |
Definition at line 1013 of file Struct.java.
References javolution.io.Struct.Member.bitIndex(), javolution.io.Struct.Member.bitLength(), and javolution.io.Struct.byteOrder().
|
package |
Definition at line 1034 of file Struct.java.
References javolution.io.Struct.Member.bitIndex(), javolution.io.Struct.Member.bitLength(), and javolution.io.Struct.byteOrder().
final int javolution.io.Struct.Member.offset | ( | ) |
Returns the byte offset of this member in its struct. Equivalent to C/C++ offsetof(struct(), this)
Definition at line 989 of file Struct.java.
References javolution.io.Struct.Member._offset.
Referenced by javolution.io.Struct.UTF8String.get(), javolution.io.Struct.Bool.get(), javolution.io.Struct.Signed8.get(), javolution.io.Struct.Unsigned8.get(), javolution.io.Struct.Signed16.get(), javolution.io.Struct.Unsigned16.get(), javolution.io.Struct.Signed32.get(), javolution.io.Struct.Unsigned32.get(), javolution.io.Struct.Signed64.get(), javolution.io.Struct.Float32.get(), javolution.io.Struct.Float64.get(), javolution.io.Struct.Enum8< T extends Enum< T >.get(), javolution.io.Struct.Enum16< T extends Enum< T >.get(), javolution.io.Struct.Enum32< T extends Enum< T >.get(), javolution.io.Struct.Enum64< T extends Enum< T >.get(), javolution.io.Struct.Reference32< S extends Struct >.isUpToDate(), javolution.io.Struct.Reference64< S extends Struct >.isUpToDate(), javolution.io.Struct.BitField.longValue(), javolution.io.Struct.UTF8String.set(), javolution.io.Struct.Bool.set(), javolution.io.Struct.Signed8.set(), javolution.io.Struct.Unsigned8.set(), javolution.io.Struct.Signed16.set(), javolution.io.Struct.Unsigned16.set(), javolution.io.Struct.Signed32.set(), javolution.io.Struct.Unsigned32.set(), javolution.io.Struct.Signed64.set(), javolution.io.Struct.BitField.set(), javolution.io.Struct.Float32.set(), javolution.io.Struct.Float64.set(), javolution.io.Struct.Reference32< S extends Struct >.set(), javolution.io.Struct.Reference64< S extends Struct >.set(), javolution.io.Struct.Enum8< T extends Enum< T >.set(), javolution.io.Struct.Enum16< T extends Enum< T >.set(), javolution.io.Struct.Enum32< T extends Enum< T >.set(), javolution.io.Struct.Enum64< T extends Enum< T >.set(), javolution.io.Struct.Reference32< S extends Struct >.value(), and javolution.io.Struct.Reference64< S extends Struct >.value().
|
package |
Definition at line 1023 of file Struct.java.
References javolution.io.Struct.Member.bitIndex(), javolution.io.Struct.Member.bitLength(), and javolution.io.Struct.byteOrder().
|
package |
Definition at line 1044 of file Struct.java.
References javolution.io.Struct.Member.bitIndex(), javolution.io.Struct.Member.bitLength(), and javolution.io.Struct.byteOrder().
final Struct javolution.io.Struct.Member.struct | ( | ) |
Returns the outer struct container.
Definition at line 979 of file Struct.java.
|
private |
Holds the relative bit offset of this member to its struct offset.
Definition at line 903 of file Struct.java.
Referenced by javolution.io.Struct.Member.bitIndex(), and javolution.io.Struct.Member.Member().
|
private |
Holds the bit length of this member.
Definition at line 907 of file Struct.java.
Referenced by javolution.io.Struct.Member.bitLength(), and javolution.io.Struct.Member.Member().
|
private |
Holds the relative offset (in bytes) of this member within its struct.
Definition at line 899 of file Struct.java.
Referenced by javolution.io.Struct.Member.Member(), and javolution.io.Struct.Member.offset().