@Shareable public class MapItemNameDAO extends Object implements ItemNameDAO, ItemDAO, Serializable
ItemNameDAO
,
Serialized FormConstructor and Description |
---|
MapItemNameDAO(Map<Long,String> items) |
Modifier and Type | Method and Description |
---|---|
static MapItemNameDAO |
fromCSVFile(File file)
Read an item list DAO from a file.
|
LongSet |
getItemIds()
Get all known item IDs.
|
String |
getItemName(long item)
Get the name for an item.
|
@Nullable public LongSet getItemIds()
ItemDAO
getItemIds
in interface ItemDAO
@Nullable public String getItemName(long item)
ItemNameDAO
getItemName
in interface ItemNameDAO
item
- The item ID.null
if the item is unknown or has no name.public static MapItemNameDAO fromCSVFile(File file) throws IOException
file
- A file of item IDs, one per line.IOException
- if there is an error reading the list of items.