swarm.space
Interface Discrete2d

All Known Subinterfaces:
Ca2d, ConwayLife2d, DblBuffer2d, Diffuse2d, Grid2d
All Known Implementing Classes:
DblBuffer2dImpl, Discrete2dImpl, Grid2dImpl

public abstract interface Discrete2d
extends SwarmObjectS, SwarmObject

Root class of all 2d discrete spaces.. A Discrete2d is basically a 2d array of ids. Subclasses add particular space semantics onto this. Currently Discrete2d grids are accessed by integer pairs of X and Y coordinates.


Method Summary
 Object copyDiscrete2d$toDiscrete2d(Discrete2dImpl a, Discrete2dImpl b)
          This method copies the data in one Discrete2d object to another Discrete2d object.
 Object fastFillWithObject(Object anObj)
          Directly fills the lattice with an object.
 Object fastFillWithValue(long aValue)
          Directly fills the lattice with a value.
 Object fillWithObject(Object anObj)
          Fills the space using putObject.
 Object fillWithValue(long aValue)
          Fills the space using putValue.
 Object getObjectAtX$Y(int x, int y)
          Return the pointer stored at (x,y).
 int getSizeX()
          Get the size of the lattice in the X dimension.
 int getSizeY()
          Get the size of the lattice in the Y dimension.
 long getValueAtX$Y(int x, int y)
          Return the integer stored at (x,y).
 Object putObject$atX$Y(Object anObject, int x, int y)
          Put the given pointer to (x,y) overwriting whatever was there.
 Object putValue$atX$Y(long v, int x, int y)
          Put the given integer to (x,y) overwriting whatever was there.
 int setDiscrete2d$toFile(Discrete2dImpl a, String filename)
          This method reads a PGM formatted file and pipes the data into a Discrete2d object.
 
Methods inherited from interface swarm.objectbase.SwarmObject
getCompleteProbeMap, getProbeForMessage, getProbeForVariable, getProbeMap
 
Methods inherited from interface swarm.defobj.Drop
drop
 
Methods inherited from interface swarm.defobj.DefinedObject
compare, describe, describeID, getDisplayName, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid
 

Method Detail

getSizeX

public int getSizeX()
Get the size of the lattice in the X dimension.

getSizeY

public int getSizeY()
Get the size of the lattice in the Y dimension.

getObjectAtX$Y

public Object getObjectAtX$Y(int x,
                             int y)
Return the pointer stored at (x,y).

getValueAtX$Y

public long getValueAtX$Y(int x,
                          int y)
Return the integer stored at (x,y).

putObject$atX$Y

public Object putObject$atX$Y(Object anObject,
                              int x,
                              int y)
Put the given pointer to (x,y) overwriting whatever was there.

putValue$atX$Y

public Object putValue$atX$Y(long v,
                             int x,
                             int y)
Put the given integer to (x,y) overwriting whatever was there.

fastFillWithValue

public Object fastFillWithValue(long aValue)
Directly fills the lattice with a value.

fastFillWithObject

public Object fastFillWithObject(Object anObj)
Directly fills the lattice with an object.

fillWithValue

public Object fillWithValue(long aValue)
Fills the space using putValue.

fillWithObject

public Object fillWithObject(Object anObj)
Fills the space using putObject.

setDiscrete2d$toFile

public int setDiscrete2d$toFile(Discrete2dImpl a,
                                String filename)
This method reads a PGM formatted file and pipes the data into a Discrete2d object.

copyDiscrete2d$toDiscrete2d

public Object copyDiscrete2d$toDiscrete2d(Discrete2dImpl a,
                                          Discrete2dImpl b)
This method copies the data in one Discrete2d object to another Discrete2d object. It assumes that both objects already exist.