DataStream (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.ml.maxent

## Interface DataStream

-     public interface DataStream

  A interface for objects which can deliver a stream of training data to be supplied to an EventStream. It is not necessary to use a DataStream in a Maxent application, but it can be used to support a wider variety of formats in which your training data can be held.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()` Test whether there are any Events remaining in this EventStream.
    `Object` | `nextToken()` Returns the next slice of data held in this DataStream.

- - ### Method Detail

    - #### nextToken

          Object nextToken()

      Returns the next slice of data held in this DataStream.
      Returns:
        the Object representing the data which is next in this DataStream

    - #### hasNext

          boolean hasNext()

      Test whether there are any Events remaining in this EventStream.
      Returns:
        true if this DataStream has more data tokens

Copyright © 2026 The Apache Software Foundation. All rights reserved.