Package rx.schedulers
Class TimeInterval<T>
- java.lang.Object
-
- rx.schedulers.TimeInterval<T>
-
- Type Parameters:
T
- the value type held along with the interval length
public class TimeInterval<T> extends java.lang.Object
ATimeInterval
represents an item emitted by anObservable
along with the amount of time that elapsed either since the emission of the previous item or (if there was no previous item) since theObservable
was first subscribed to.
-
-
Field Summary
Fields Modifier and Type Field Description private long
intervalInMilliseconds
private T
value
-
Constructor Summary
Constructors Constructor Description TimeInterval(long intervalInMilliseconds, T value)
Creates aTimeInterval
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
long
getIntervalInMilliseconds()
Returns the time interval, expressed in milliseconds.T
getValue()
Returns the item that was emitted by the Observable after this time interval.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
intervalInMilliseconds
private final long intervalInMilliseconds
-
value
private final T value
-
-
Constructor Detail
-
TimeInterval
public TimeInterval(long intervalInMilliseconds, T value)
Creates aTimeInterval
object.- Parameters:
intervalInMilliseconds
- the number of milliseconds between the time whenvalue
was emitted and the item that was emitted immediately prior tovalue
, or, if there was no such prior item, since the initial subscription to theObservable
value
- the item emitted by the Observable
-
-
Method Detail
-
getIntervalInMilliseconds
public long getIntervalInMilliseconds()
Returns the time interval, expressed in milliseconds.- Returns:
- the time interval in milliseconds
-
getValue
public T getValue()
Returns the item that was emitted by the Observable after this time interval.- Returns:
- the item that was emitted by the Observable
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-