Class UniversalMapInfo

java.lang.Object
net.mtrop.doom.text.UniversalMapInfo
All Implemented Interfaces:
Iterable<Map.Entry<String,MapInfoData[]>>, TextObject

public class UniversalMapInfo extends Object implements TextObject, Iterable<Map.Entry<String,MapInfoData[]>>
An abstraction of the Universal Map Info entry (UMAPINFO). Entry headers are stored case-insensitively, for convenience.
Since:
2.19.0
Author:
Matthew Tropiano
  • Constructor Details

    • UniversalMapInfo

      public UniversalMapInfo()
  • Method Details

    • addEntry

      public void addEntry(String header, MapInfoData... data)
      Adds a new entry to this EMAPINFO.
      Parameters:
      header - the header name (without brackets).
      data - the contained data entries.
    • containsEntry

      public boolean containsEntry(String header)
      Checks if this contains an entry by name.
      Parameters:
      header - the header name.
      Returns:
      true if so, false if not.
    • getEntry

      public MapInfoData[] getEntry(String header)
      Fetches an entry from this map info by map header.
      Parameters:
      header - the header name.
      Returns:
      the corresponding data, or null if no data.
      Since:
      2.19.2
    • removeEntry

      public MapInfoData[] removeEntry(String header)
      Removes an entry from this map info and returns the associated data, if it existed.
      Parameters:
      header - the entry name to remove.
      Returns:
      the associated data from the removed entry, or null if no corresponding entry.
    • iterator

      public Iterator<Map.Entry<String,MapInfoData[]>> iterator()
      Specified by:
      iterator in interface Iterable<Map.Entry<String,MapInfoData[]>>
    • readText

      public void readText(Reader reader) throws IOException
      Description copied from interface: TextObject
      Reads from an Reader and sets this object's fields.
      Specified by:
      readText in interface TextObject
      Parameters:
      reader - the Reader to read from.
      Throws:
      IOException - if a read error occurs.
    • writeText

      public void writeText(Writer writer) throws IOException
      Description copied from interface: TextObject
      Writes this object to a Writer.
      Specified by:
      writeText in interface TextObject
      Parameters:
      writer - the Writer to write to.
      Throws:
      IOException - if a write error occurs.