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

opennlp.tools.ml.model

## Class ComparableEvent

- java.lang.Object
- - opennlp.tools.ml.model.ComparableEvent

- All Implemented Interfaces:
    Comparable<ComparableEvent>

      public class ComparableEvent
      extends Object
      implements Comparable<ComparableEvent>

  A maxent event representation which we can use to sort based on the predicates indexes contained in the events.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `outcome`
    `int[]` | `predIndexes`
    `int` | `seen`
    `float[]` | `values`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComparableEvent(int oc, int[] pids)`
    `ComparableEvent(int oc, int[] pids, float[] values)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(ComparableEvent ce)`
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `String` | `toString()`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### outcome

          public int outcome

    - #### predIndexes

          public int[] predIndexes

    - #### seen

          public int seen

    - #### values

          public float[] values

  - ### Constructor Detail

    - #### ComparableEvent

          public ComparableEvent(int oc,
                                 int[] pids,
                                 float[] values)

    - #### ComparableEvent

          public ComparableEvent(int oc,
                                 int[] pids)

  - ### Method Detail

    - #### compareTo

          public int compareTo(ComparableEvent ce)

      Specified by:
        `compareTo` in interface `Comparable<ComparableEvent>`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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