Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.3 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javolution.io
Class Struct.Member

    java.lang.Object
      javolution.io.Struct.Member

Direct Known Subclasses:
  Struct.Bool, Struct.Enum16, Struct.Enum32, Struct.Enum64, Struct.Enum8, Struct.Float32, Struct.Float64, Struct.Reference32, Struct.Reference64, Struct.Signed16, Struct.Signed32, Struct.Signed64, Struct.Signed8, Struct.Unsigned16, Struct.Unsigned32, Struct.Unsigned8, Struct.UTF8String

Enclosing class:
  Struct

    protected class Struct.Member

extends java.lang.Object

This inner class represents the base class for all `Struct` members. It allows applications to define additional member types. For example:``

        public class MyStruct extends Struct {
            BitSet bits = new BitSet(256);
            ...
            public BitSet extends Member {
                public BitSet(int nbrBits) {
                    super(1, (nbrBits+7)>>3);
                }
                public boolean get(int i) { ... }
                public void set(int i, boolean value) { ...}
            }
        }

Field Summary
`protected int` | `_bitCount` Holds the number of bits reserved by this member

Constructor Summary
`protected` | `Struct.Member(int alignment, int size)` Base constructor for custom member types.

Method Summary
`int` | `bitCount()` Returns the number of bits in this member
`int` | `offset()` Returns the relative offset of this member within its struct.
`int` | `position()` Returns the absolute position of this member in the byte buffer.
`Struct` | `struct()` Returns the outer `struct` container.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _bitCount

    protected final int _bitCount

  Holds the number of bits reserved by this member

Constructor Detail

### Struct.Member

    protected Struct.Member(int alignment,
                            int size)

  Base constructor for custom member types.

  Parameters:
    `alignment` - the desired alignment in bytes.
    `size` - the size of this member in bytes.

Method Detail

### struct

    public final Struct struct()

  Returns the outer `struct` container.

  Returns:
    the outer struct.

### bitCount

    public final int bitCount()

  Returns the number of bits in this member

  Returns:
    the number of bits in the Member

### offset

    public final int offset()

  Returns the relative offset of this member within its struct.

  Returns:
    the relative offset in bytes.

### position

    public final int position()

  Returns the absolute position of this member in the byte buffer.

  Returns:
    the byte buffer position.

Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.3 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 - 2009 Javolution.