|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.memphis.ccrg.lida.episodicmemory.sdm.HardLocationImpl
public class HardLocationImpl
Default implementation of HardLocation
.
Constructor Summary | |
---|---|
HardLocationImpl(cern.colt.bitvector.BitVector address)
Constructs a new hard location with specified address |
|
HardLocationImpl(cern.colt.bitvector.BitVector address,
int wordLength)
Constructs a new hard location with specified address and length. |
Method Summary | |
---|---|
cern.colt.bitvector.BitVector |
getAddress()
Gets address |
byte[] |
getCounters()
Returns the counters of this HardLocation Each HardLocation has wordSize counters. |
int |
getWriteCount()
Gets write count |
int |
hammingDistance(cern.colt.bitvector.BitVector vector)
Returns the Hamming distance between a BitVector and the address of this HardLocation |
int[] |
read(int[] buff)
Reads this HardLocation. |
void |
setAddress(cern.colt.bitvector.BitVector address)
Sets the address of this HardLocation in the vector space |
void |
setCounters(byte[] newCounters)
Sets the counters of this HardLocation Each HardLocation has wordSize counters. |
void |
write(cern.colt.bitvector.BitVector word)
Writes specified BitVector to this HardLocation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HardLocationImpl(cern.colt.bitvector.BitVector address, int wordLength)
address
- BitVector
wordLength
- length of the wordspublic HardLocationImpl(cern.colt.bitvector.BitVector address)
address
- BitVector
address of this HardLocationMethod Detail |
---|
public cern.colt.bitvector.BitVector getAddress()
HardLocation
getAddress
in interface HardLocation
public void setAddress(cern.colt.bitvector.BitVector address)
HardLocation
setAddress
in interface HardLocation
address
- the BitVector
address to setpublic byte[] getCounters()
HardLocation
getCounters
in interface HardLocation
public int getWriteCount()
HardLocation
getWriteCount
in interface HardLocation
public void write(cern.colt.bitvector.BitVector word)
HardLocation
BitVector
to this HardLocation.
For each bit in word, the corresponding counter is incremented if the bit is 1 or decremented if
the bit is 0.
write
in interface HardLocation
word
- word to be writtenpublic void setCounters(byte[] newCounters)
HardLocation
setCounters
in interface HardLocation
newCounters
- new counterspublic int[] read(int[] buff)
HardLocation
read
in interface HardLocation
buff
- an int[] buffer where the result of the read is added
public int hammingDistance(cern.colt.bitvector.BitVector vector)
HardLocation
BitVector
and the address of this HardLocation
hammingDistance
in interface HardLocation
vector
- BitVector
to be compared with this HardLocation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |