diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-08-26 16:45:14 -0700 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-08-26 16:45:14 -0700 |
commit | b120e24fe04b987cfb5c487251fc10e36b377d6b (patch) | |
tree | 20e1a0058bf2155669b4aaab3b3ad5f74d17ee7b /streaming | |
parent | 06ef7c3d1bf8446d4d6ef8f3a055dd1e6d32ca3a (diff) | |
download | spark-b120e24fe04b987cfb5c487251fc10e36b377d6b.tar.gz spark-b120e24fe04b987cfb5c487251fc10e36b377d6b.tar.bz2 spark-b120e24fe04b987cfb5c487251fc10e36b377d6b.zip |
Add equals and hashCode to Time
Diffstat (limited to 'streaming')
-rw-r--r-- | streaming/src/main/scala/spark/streaming/Time.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/streaming/src/main/scala/spark/streaming/Time.scala b/streaming/src/main/scala/spark/streaming/Time.scala index 3901a26286..7835bdd5e8 100644 --- a/streaming/src/main/scala/spark/streaming/Time.scala +++ b/streaming/src/main/scala/spark/streaming/Time.scala @@ -55,6 +55,14 @@ class Time(private var millis: Long) extends Serializable { def toFormattedString = millis.toString def milliseconds = millis + + override def hashCode = millis.toInt + + override def equals(other: Any): Boolean = other match { + case null => false + case t: Time => t.millis == millis + case _ => false + } } object Time { |