Class Similarity

    • Constructor Detail

      • Similarity

        public Similarity​(long a,
                          long b,
                          long duration)
        Creates a similarity, describing two audio signal segments that have a high similarity.
        Parameters:
        a - start time in milliseconds
        b - start time in milliseconds
        duration - length in milliseconds
      • Similarity

        public Similarity​(org.json.simple.JSONObject jsonObject)
    • Method Detail

      • getA

        public long getA()
      • getB

        public long getB()
      • getDuration

        public long getDuration()
      • translate

        public long translate​(long time)
        Translates a point in time to a similar point in time described by this Similarity.
        Parameters:
        time - time in milliseconds
        Returns:
        either a point in time or -1, if time is not contained in either of the two audio segments described by this similarity
      • contains

        public final boolean contains​(long time)
      • isDuringB

        public final boolean isDuringB​(long time)
      • isDuringA

        public final boolean isDuringA​(long time)
      • overlaps

        public boolean overlaps​(Similarity that)
        Indicates whether the two similarities overlap in any way.
        Parameters:
        that - other similarity
        Returns:
        true, if there is some overlap
      • getA

        public long getA​(TimeUnit timeUnit)
      • getB

        public long getB​(TimeUnit timeUnit)
      • getDuration

        public long getDuration​(TimeUnit timeUnit)
      • translate

        public long translate​(long time,
                              TimeUnit timeUnit)
        Translates a point in time to a similar point in time described by this Similarity.
        Parameters:
        time - time
        timeUnit - time unit, time is in
        Returns:
        either a point in time or -1, if time is not contained in either of the two audio segments described by this similarity
      • contains

        public boolean contains​(long time,
                                TimeUnit timeUnit)
      • isRepeat

        public boolean isRepeat()
        Indicates whether the two similar segments follow each other right away.
        Returns:
        true or false
      • toJSONString

        public String toJSONString()
        Specified by:
        toJSONString in interface org.json.simple.JSONAware
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object