Class Database.WorldEntry

All Implemented Interfaces:
Named
Enclosing class:
Database

public static class Database.WorldEntry extends Database.Listable
Author:
Stephen G. Ware
  • Constructor Details

    • WorldEntry

      public WorldEntry(WorldModel world)
      Constructs a new world database entry from a world model, using the world's name.
      Parameters:
      world - the world represented in this entry
  • Method Details

    • getWorld

      public WorldModel getWorld()
      Returns this entry world's model.
      Returns:
      the world model
    • setWorld

      protected void setWorld(WorldModel world)
      Sets this entry's world model. This method does not update the final name field 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

      protected void setPath(String path)
      Sets the URL of the file where this entry's world model is serialized.
      Parameters:
      path - the path to the world model file
    • read

      protected void read() throws IOException
      Deserializes this entry's world model from the file where 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