Class Database.WorldEntry
java.lang.Object
edu.uky.cs.nil.tt.Database.Entry
edu.uky.cs.nil.tt.Database.Listable
edu.uky.cs.nil.tt.Database.WorldEntry
- All Implemented Interfaces:
Named
- Enclosing class:
Database
A
database entry for a story world.- Author:
- Stephen G. Ware
-
Constructor Summary
ConstructorsConstructorDescriptionWorldEntry(WorldModel world) Constructs a new world database entry from a world model, using theworld's name. -
Method Summary
Modifier and TypeMethodDescriptiongetWorld()Returns this entry world's model.protected voidread()Deserializes this entry's world model from thefilewhere the world model is stored.protected voidSets the URL of the file where this entry's world model is serialized.protected voidsetWorld(WorldModel world) Sets this entry'sworld model.Methods inherited from class Database.Listable
getListed, setListedMethods inherited from class Database.Entry
getDescription, getName, getTitle, setDescription, setTitle, toString
-
Constructor Details
-
WorldEntry
Constructs a new world database entry from a world model, using theworld's name.- Parameters:
world- the world represented in this entry
-
-
Method Details
-
getWorld
-
setWorld
Sets this entry'sworld model. This method does not update the finalnamefield of the entry, so the world model given should have the same name as this entry.- Parameters:
world- the new world model for this entry
-
setPath
Sets the URL of the file where this entry's world model is serialized.- Parameters:
path- the path to the world model file
-
read
Deserializes this entry's world model from thefilewhere the world model is stored.- Throws:
IOException- if this entry's path is not set, if the file is not found, or if there is a problem deserializing the world model
-