com.tibbo.aggregate.common.communication

## Class BufferedCommandParser<C extends Command>

- java.lang.Object
- - com.tibbo.aggregate.common.communication.AbstractCommandParser<C>
  - - com.tibbo.aggregate.common.communication.BufferedCommandParser<C>

- All Implemented Interfaces:
    CommandParser<C>
  Direct Known Subclasses:
    SimpleCommandParser

      public abstract class BufferedCommandParser<C extends Command>
      extends AbstractCommandParser<C>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.nio.ByteBuffer` | `buffer`
    `protected java.nio.channels.ReadableByteChannel` | `channel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BufferedCommandParser(java.nio.channels.ReadableByteChannel channel)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract C` | `buildCommand()`
    `protected boolean` | `commandCompleted()`
    `protected abstract boolean` | `commandEnded(byte cur)`
    `java.nio.channels.ReadableByteChannel` | `getChannel()`
    `C` | `readCommand()`

    - ### Methods inherited from class com.tibbo.aggregate.common.communication.AbstractCommandParser

      `addData, clearData, getData, getListener, reset, setListener, toString`

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

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

- - ### Field Detail

    - #### buffer

          protected final java.nio.ByteBuffer buffer

    - #### channel

          protected java.nio.channels.ReadableByteChannel channel

  - ### Constructor Detail

    - #### BufferedCommandParser

          public BufferedCommandParser(java.nio.channels.ReadableByteChannel channel)

  - ### Method Detail

    - #### commandCompleted

          protected boolean commandCompleted()

    - #### readCommand

          public C readCommand()
                        throws java.io.IOException,
                               DisconnectionException,
                               SyntaxErrorException

      Throws:
        `java.io.IOException`
        `DisconnectionException`
        `SyntaxErrorException`

    - #### buildCommand

          protected abstract C buildCommand()
                                     throws SyntaxErrorException

      Throws:
        `SyntaxErrorException`

    - #### commandEnded

          protected abstract boolean commandEnded(byte cur)

    - #### getChannel

          public java.nio.channels.ReadableByteChannel getChannel()