lev

## Class LFlags

- java.lang.Object
- - lev.LFlags

- All Implemented Interfaces:
    java.io.Serializable

      public class LFlags
      extends java.lang.Object
      implements java.io.Serializable

  An object that is meant to hold a set of boolean flags. Takes in byte arrays and converts each bit to its own flag.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LFlags(byte[] inFlags)`
    `LFlags(int size)`
    `LFlags(LFlags rhs)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Sets all flags to false.
    `boolean` | `equals(java.lang.Object obj)`
    `byte[]` | `export()` Converts the boolean flags to a byte array.
    `boolean` | `get(int bit)`
    `int` | `getFirstTrue()`
    `int` | `hashCode()`
    `boolean` | `isZeros()`
    `int` | `length()`
    `void` | `set(byte[] inFlags)` Resizes LFlags to contain bytes and their associated flags
    `void` | `set(int bit, boolean on)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LFlags

          public LFlags(int size)

      Parameters:
        `size` - number of bytes-worth of flags to initialize.

    - #### LFlags

          public LFlags(byte[] inFlags)

      Parameters:
        `inFlags` - bytes to initialize flags to.

    - #### LFlags

          public LFlags(LFlags rhs)

      Parameters:
        `rhs` -

  - ### Method Detail

    - #### set

          public final void set(byte[] inFlags)

      Resizes LFlags to contain bytes and their associated flags
      Parameters:
        `inFlags` - bytes to set LFlags to.

    - #### get

          public final boolean get(int bit)

      Parameters:
        `bit` - Bit/Flag to check
      Returns:
        True if bit/Flag is on

    - #### set

          public final void set(int bit,
                 boolean on)

      Parameters:
        `bit` - Bit/Flag to check
        `on` - Sets the bit/flag on/off

    - #### getFirstTrue

          public final int getFirstTrue()

      Returns:
        Index of the first true flag.

    - #### export

          public final byte[] export()

      Converts the boolean flags to a byte array.
      Returns:
        Byte array containing all the flags as bits.

    - #### length

          public final int length()

      Returns:
        Length of the byte array representation

    - #### clear

          public final void clear()

      Sets all flags to false.

    - #### isZeros

          public boolean isZeros()

      Returns:
        True if all flags are set to false

    - #### toString

          public final java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        String of 1's and 0's. Beep boop beep.

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`