Class MemoryLocation
java.lang.Object
uk.ac.manchester.spinnaker.machine.MemoryLocation
- All Implemented Interfaces:
Comparable<MemoryLocation>
A location in SpiNNaker or BMP memory. Does not say which address space this
is in.
- Author:
- Donal Fellows
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intThe actual location.static final MemoryLocationThe zero memory location. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int offset) Add an offset to this location to get a new memory location.intcompareTo(MemoryLocation other) intdiff(MemoryLocation other) Get the difference between this location and another.booleanbooleangreaterThan(MemoryLocation other) Test if this location is greater than another location.inthashCode()booleanbooleanisNull()booleanlessThan(MemoryLocation other) Test if this location is less than another location.intHow many bytes is this location's address above a word-aligned address?toString()
-
Field Details
-
NULL
The zero memory location. Often means "no actual address". -
address
public final int addressThe actual location.
-
-
Constructor Details
-
MemoryLocation
public MemoryLocation(int address) - Parameters:
address- The actual location.
-
MemoryLocation
public MemoryLocation(long address) - Parameters:
address- The actual location.
-
-
Method Details
-
add
Add an offset to this location to get a new memory location.- Parameters:
offset- The offset to add.- Returns:
- The new memory location.
-
diff
Get the difference between this location and another.- Parameters:
other- The other location.- Returns:
- This location's address minus the other location's address.
-
isNull
public boolean isNull()- Returns:
- Whether this location is really null.
-
subWordAlignment
public int subWordAlignment()How many bytes is this location's address above a word-aligned address?- Returns:
- The number of bytes offset.
-
isAligned
public boolean isAligned()- Returns:
- Whether this is a word-aligned location.
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<MemoryLocation>
-
lessThan
Test if this location is less than another location.- Parameters:
other- The other location.- Returns:
- True if this location's address comes before.
-
greaterThan
Test if this location is greater than another location.- Parameters:
other- The other location.- Returns:
- True if this location's address comes after.
-
toString
-