mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sro...@apache.org
Subject svn commit: r948575 - /mahout/trunk/core/src/main/java/org/apache/mahout/math/VarIntWritable.java
Date Wed, 26 May 2010 20:35:44 GMT
Author: srowen
Date: Wed May 26 20:35:44 2010
New Revision: 948575

URL: http://svn.apache.org/viewvc?rev=948575&view=rev
Log:
How did this class disappear?

Added:
    mahout/trunk/core/src/main/java/org/apache/mahout/math/VarIntWritable.java
      - copied, changed from r948561, mahout/trunk/core/src/main/java/org/apache/mahout/math/VarLongWritable.java

Copied: mahout/trunk/core/src/main/java/org/apache/mahout/math/VarIntWritable.java (from r948561,
mahout/trunk/core/src/main/java/org/apache/mahout/math/VarLongWritable.java)
URL: http://svn.apache.org/viewvc/mahout/trunk/core/src/main/java/org/apache/mahout/math/VarIntWritable.java?p2=mahout/trunk/core/src/main/java/org/apache/mahout/math/VarIntWritable.java&p1=mahout/trunk/core/src/main/java/org/apache/mahout/math/VarLongWritable.java&r1=948561&r2=948575&rev=948575&view=diff
==============================================================================
--- mahout/trunk/core/src/main/java/org/apache/mahout/math/VarLongWritable.java (original)
+++ mahout/trunk/core/src/main/java/org/apache/mahout/math/VarIntWritable.java Wed May 26
20:35:44 2010
@@ -23,33 +23,33 @@ import java.io.IOException;
 
 import org.apache.hadoop.io.WritableComparable;
 
-public class VarLongWritable implements WritableComparable<VarLongWritable>, Cloneable
{
+public class VarIntWritable implements WritableComparable<VarIntWritable>, Cloneable
{
 
-  private long value;
+  private int value;
 
-  public VarLongWritable() {
+  public VarIntWritable() {
   }
 
-  public VarLongWritable(long value) {
+  public VarIntWritable(int value) {
     this.value = value;
   }
 
-  public long get() {
+  public int get() {
     return value;
   }
 
-  public void set(long value) {
+  public void set(int value) {
     this.value = value;
   }
 
   @Override
   public boolean equals(Object other) {
-    return other instanceof VarLongWritable && ((VarLongWritable) other).value ==
value;
+    return other instanceof VarIntWritable && ((VarIntWritable) other).value == value;
   }
 
   @Override
   public int hashCode() {
-    return (int) ((value >>> 32) ^ value);
+    return value;
   }
 
   @Override
@@ -58,12 +58,12 @@ public class VarLongWritable implements 
   }
 
   @Override
-  public VarLongWritable clone() {
-    return new VarLongWritable(value);
+  public VarIntWritable clone() {
+    return new VarIntWritable(value);
   }
 
   @Override
-  public int compareTo(VarLongWritable other) {
+  public int compareTo(VarIntWritable other) {
     if (value < other.value) {
       return -1;
     } else if (value > other.value) {
@@ -74,12 +74,12 @@ public class VarLongWritable implements 
 
   @Override
   public void write(DataOutput out) throws IOException {
-    Varint.writeSignedVarLong(value, out);
+    Varint.writeSignedVarInt(value, out);
   }
 
   @Override
   public void readFields(DataInput in) throws IOException {
-    value = Varint.readSignedVarLong(in);
+    value = Varint.readSignedVarInt(in);
   }
 
 }
\ No newline at end of file



Mime
View raw message