Class SuperMap<R, T extends GObject>

java.lang.Object
com.yetnt.utils.tuple.Pair<HashMultiMap<R,T>, HashMap<R,T>>
com.j3d.storage.files.protocol.proj.SuperMap<R,T>
Type Parameters:
R - The key type used to identify values in both maps. This is abstracted since PF3 uses strings, but PF4 uses the actual UUID value
T - The type of GObject stored in the maps.
Direct Known Subclasses:
PF3.SuperMap, PF4.SuperMap

class SuperMap<R, T extends GObject> extends Pair<HashMultiMap<R,T>, HashMap<R,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<R,T> thingParentMap, HashMap<R,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<R,T> getThingParentMap()
      Returns the HashMultiMap that maps parent thing IDs to geometric objects.
      Returns:
      The parent thing map.
    • getIdMap

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

      public ArrayList<T> fromThing(R 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.