swarm.space
Interface Int2dFiler
- All Known Implementing Classes:
- Int2dFilerImpl
- public interface Int2dFiler
- extends SwarmObject, SwarmObjectS
Saves the state of a Discrete2d object [DEPRECATED]..
The Int2dFiler class is used to save the state of any Discrete2d object (or a subclass thereof) to a specified file. Use of this protocol is deprecated, the ability to write the state of a Discrete2d instance to disk (serialize) is now encoded directly to the Discrete2d class, via the lisp and HDF5 archiver features.
Method Summary |
java.lang.Object |
fileTo(java.lang.String aFileName)
When the Int2dFiler receives this message, it opens a file called fileName, stores the state of a pre-specified space into it, and then closes the file. |
java.lang.Object |
setBackground(int aValue)
This message is optional. |
java.lang.Object |
setDiscrete2dToFile(Discrete2d sSpace)
Set the target space to be filled. |
java.lang.Object |
setValueMessage(Selector aSelector)
This message is optional. |
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 |
setDiscrete2dToFile
public java.lang.Object setDiscrete2dToFile(Discrete2d sSpace)
- Set the target space to be filled. This message can be used more than once, but often it is useful to keep one Int2dFiler per space (e.g. when the space is saved multiple times).
setValueMessage
public java.lang.Object setValueMessage(Selector aSelector)
- This message is optional. It is used when the target Discrete2d contains objects. By sending each object the message specified by the selector, the Int2dFiler is able to get from the object an integer representing its state, which it then writes to the file.
setBackground
public java.lang.Object setBackground(int aValue)
- This message is optional. It is used when the target Discrete2d contains objects. If a particular location in the space has no resident object, the argument of this message is the value which gets writtent to the file. The default background value is 0.
fileTo
public java.lang.Object fileTo(java.lang.String aFileName)
- When the Int2dFiler receives this message, it opens a file called fileName, stores the state of a pre-specified space into it, and then closes the file.