Class LocalMaximaOutput


  • public class LocalMaximaOutput
    extends Object
    Represents the output of a local maxima detection operation.

    This class encapsulates the indices of the midpoints of local maxima, along with their corresponding left and right edges.

    • Constructor Detail

      • LocalMaximaOutput

        public LocalMaximaOutput​(int[] midpoints,
                                 int[] leftEdges,
                                 int[] rightEdges)
        Constructs a new LocalMaximaOutput object with the specified midpoints, left edges, and right edges.
        Parameters:
        midpoints - an array of integers representing the midpoints of the local maxima
        leftEdges - an array of integers representing the left edges of the local maxima
        rightEdges - an array of integers representing the right edges of the local maxima
    • Method Detail

      • getMidpoints

        public int[] getMidpoints()
        Returns the midpoints of the detected local maxima.
        Returns:
        an array of integers representing the midpoints
      • getLeftEdges

        public int[] getLeftEdges()
        Returns the left edges of the detected local maxima.
        Returns:
        an array of integers representing the left edges
      • getRightEdges

        public int[] getRightEdges()
        Returns the right edges of the detected local maxima.
        Returns:
        an array of integers representing the right edges
      • equals

        public boolean equals​(Object o)
        Compares this object to another object for equality.

        Two LocalMaximaOutput objects are considered equal if their midpoints, left edges, and right edges arrays are all equal.

        Overrides:
        equals in class Object
        Parameters:
        o - the object to compare to
        Returns:
        true if the objects are equal, false otherwise
      • hashCode

        public int hashCode()
        Computes the hash code for this LocalMaximaOutput object.

        The hash code is computed based on the midpoints, left edges, and right edges arrays.

        Overrides:
        hashCode in class Object
        Returns:
        the hash code value