Class PF3.SuperMap<T extends GObject>

java.lang.Object
com.yetnt.utils.tuple.Pair<HashMultiMap<String,T>,HashMap<String,T>>
com.j3d.storage.files.protocol.proj.PF3.SuperMap<T>
Type Parameters:
T - The type of GObject stored in the maps.
Enclosing class:
PF3

public static class PF3.SuperMap<T extends GObject> extends Pair<HashMultiMap<String,T>,HashMap<String,T>>
A utility class that extends Pair to store two maps related to some GObject. It holds a HashMultiMap to map parent thing IDs to a list of geometric objects, and a HashMap to map individual geometric object IDs to the objects themselves.
  • Constructor Details

    • SuperMap

      public SuperMap(HashMultiMap<String,T> thingParentMap, HashMap<String,T> idMap)
      Constructs a new SuperMap with the given parent map and ID map.
      Parameters:
      thingParentMap - A HashMultiMap mapping parent thing IDs to geometric objects.
      idMap - A HashMap mapping geometric object IDs to geometric objects.
  • Method Details

    • getThingParentMap

      public HashMultiMap<String,T> getThingParentMap()
      Returns the HashMultiMap that maps parent thing IDs to geometric objects.
      Returns:
      The parent thing map.
    • getIdMap

      public HashMap<String,T> getIdMap()
      Returns the HashMap that maps geometric object IDs to geometric objects.
      Returns:
      The ID map.
    • fromThing

      public ArrayList<T> fromThing(String thingId)
      Retrieves a list of geometric objects associated with a specific parent thing ID. If no objects are found for the given thing ID, an empty ArrayList is returned.
      Parameters:
      thingId - The ID of the parent thing.
      Returns:
      An ArrayList of geometric objects belonging to the specified thing.