Package net.mtrop.doom.text
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.mtrop.doom.object.TextObject
TextObject.ParseException, TextObject.Reflect, TextObject.Transformer<TO extends TextObject>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEntry
(String header, MapInfoData... data) Adds a new entry to this EMAPINFO.boolean
containsEntry
(String header) Checks if this contains an entry by name.Fetches an entry from this map info by map header.iterator()
void
Reads from anReader
and sets this object's fields.removeEntry
(String header) Removes an entry from this map info and returns the associated data, if it existed.void
Writes this object to aWriter
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
UniversalMapInfo
public UniversalMapInfo()
-
-
Method Details
-
addEntry
Adds a new entry to this EMAPINFO.- Parameters:
header
- the header name (without brackets).data
- the contained data entries.
-
containsEntry
Checks if this contains an entry by name.- Parameters:
header
- the header name.- Returns:
- true if so, false if not.
-
getEntry
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
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
- Specified by:
iterator
in interfaceIterable<Map.Entry<String,
MapInfoData[]>>
-
readText
Description copied from interface:TextObject
Reads from anReader
and sets this object's fields.- Specified by:
readText
in interfaceTextObject
- Parameters:
reader
- theReader
to read from.- Throws:
IOException
- if a read error occurs.
-
writeText
Description copied from interface:TextObject
Writes this object to aWriter
.- Specified by:
writeText
in interfaceTextObject
- Parameters:
writer
- theWriter
to write to.- Throws:
IOException
- if a write error occurs.
-