-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delete some file and use ByteArray is query key
- Loading branch information
linong.cao
committed
Mar 1, 2012
1 parent
0d11878
commit 122c038
Showing
18 changed files
with
175 additions
and
607 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,10 +97,4 @@ public static MongoDB getInstance(){ | |
return mogdb; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.db.letdb; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* @created: Mar 1, 2012 | ||
* @author : jias chao<[email protected]> | ||
*/ | ||
public class ByteArray { | ||
|
||
private byte[] array; | ||
|
||
private int len; | ||
|
||
public ByteArray(byte[] array){ | ||
this(array,array.length); | ||
} | ||
|
||
public ByteArray(byte[] array,int len){ | ||
this.array = array; | ||
this.len = len; | ||
} | ||
|
||
public byte[] getArray(){ | ||
return array; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object other){ | ||
if (other instanceof ByteArray){ | ||
ByteArray oa = (ByteArray)other; | ||
if (oa.getLen() == this.len){ | ||
for (int i=0;i<len;i++){ | ||
if (oa.getArray()[i] != array[i]){ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public int hashCode(){ | ||
int hash = Arrays.hashCode(array); | ||
return hash; | ||
} | ||
|
||
public int getLen() { | ||
return len; | ||
} | ||
|
||
public void setLen(int len) { | ||
this.len = len; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.