Class SDPLocation
java.lang.Object
uk.ac.manchester.spinnaker.messages.sdp.SDPLocation
- All Implemented Interfaces:
HasBMPLocation
,HasChipLocation
,HasCoreLocation
public class SDPLocation extends Object implements HasCoreLocation, HasBMPLocation
Represents a location in an SDP message. This could be a core location
or a BMP location. As such it can be interpreted as either.
-
Constructor Summary
Constructors Constructor Description SDPLocation(int major, int minor, int detail)
Make an SDPLocation from components.SDPLocation(HasBMPLocation bmp)
Make an SDPLocation from a BMP location.SDPLocation(HasCoreLocation core)
Make an SDPLocation from a core location. -
Method Summary
Modifier and Type Method Description BMPLocation
asBMPLocation()
Converts (if required) this to a simple X, Y, P tuple.ChipLocation
asChipLocation()
Converts (if required) this to a simple X, Y tuple.CoreLocation
asCoreLocation()
Converts (if required) this to a simple X, Y, P tuple.boolean
equals(Object obj)
int
getBoard()
int
getCabinet()
int
getFrame()
int
getP()
int
getX()
int
getY()
int
hashCode()
String
toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasChipLocation
getScampCore, onSameChipAs
-
Constructor Details
-
SDPLocation
Make an SDPLocation from a core location.- Parameters:
core
- The core location to use.
-
SDPLocation
Make an SDPLocation from a BMP location.- Parameters:
bmp
- The BMP location to use.
-
SDPLocation
public SDPLocation(int major, int minor, int detail)Make an SDPLocation from components.- Parameters:
major
- The first part of the location (x or cabinet).minor
- The second part of the location (y or frame).detail
- The third part of the location (p or board).
-
-
Method Details
-
getX
public int getX()- Specified by:
getX
in interfaceHasChipLocation
- Returns:
- The X coordinate of the chip.
-
getY
public int getY()- Specified by:
getY
in interfaceHasChipLocation
- Returns:
- The Y coordinate of the chip.
-
getP
public int getP()- Specified by:
getP
in interfaceHasCoreLocation
- Returns:
- The processor coordinate of the core on its chip.
-
getCabinet
public int getCabinet()- Specified by:
getCabinet
in interfaceHasBMPLocation
- Returns:
- The cabinet number of the board. Not actually a processor coordinate.
-
getFrame
public int getFrame()- Specified by:
getFrame
in interfaceHasBMPLocation
- Returns:
- The frame number of the board. Not actually a processor coordinate.
-
getBoard
public int getBoard()- Specified by:
getBoard
in interfaceHasBMPLocation
- Returns:
- The board number of the board. Not actually a processor ID.
-
asChipLocation
Description copied from interface:HasChipLocation
Converts (if required) this to a simple X, Y tuple.- Specified by:
asChipLocation
in interfaceHasChipLocation
- Returns:
- A ChipLocation representation of the X and Y tuple
-
asCoreLocation
Description copied from interface:HasCoreLocation
Converts (if required) this to a simple X, Y, P tuple.- Specified by:
asCoreLocation
in interfaceHasCoreLocation
- Returns:
- A CoreLocation representation of the X, Y, P tuple
-
asBMPLocation
Description copied from interface:HasBMPLocation
Converts (if required) this to a simple X, Y, P tuple.- Specified by:
asBMPLocation
in interfaceHasBMPLocation
- Returns:
- A CoreLocation representation of the X, Y, P tuple
-
toString
-
hashCode
public int hashCode() -
equals
-