Class ArcCollections

java.lang.Object
com.xpdustry.distributor.collection.ArcCollections

public final class ArcCollections extends Object
A utility class for wrapping arc collections into standard java collections.
  • Method Details

    • mutableSet

      public static <E> Set<E> mutableSet(arc.struct.ObjectSet<E> seq)
      Wraps an ObjectSet into a Set.
      Type Parameters:
      E - the element type
      Parameters:
      seq - the arc set
      Returns:
      the wrapped set
    • immutableSet

      public static <E> Set<E> immutableSet(arc.struct.ObjectSet<E> seq)
      Wraps an ObjectSet into an immutable Set.
      Type Parameters:
      E - the element type
      Parameters:
      seq - the arc set
      Returns:
      the wrapped ObjectSet
    • mutableList

      public static <E> List<E> mutableList(arc.struct.Seq<E> seq)
      Wraps a Seq into a List.
      Type Parameters:
      E - the element type
      Parameters:
      seq - the arc list
      Returns:
      the wrapped Seq
    • immutableList

      public static <E> List<E> immutableList(arc.struct.Seq<E> seq)
      Wraps a Seq into an immutable List.
      Type Parameters:
      E - the element type
      Parameters:
      seq - the arc list
      Returns:
      the wrapped Seq
    • mutableList

      public static <E extends mindustry.gen.Entityc> List<E> mutableList(mindustry.entities.EntityGroup<E> group)
      Wraps an EntityGroup into a List.
      Type Parameters:
      E - the entity type
      Parameters:
      group - the entity group
      Returns:
      the wrapped EntityGroup
    • immutableList

      public static <E extends mindustry.gen.Entityc> List<E> immutableList(mindustry.entities.EntityGroup<E> group)
      Wraps an EntityGroup into an immutable List.
      Type Parameters:
      E - the entity type
      Parameters:
      group - the entity group
      Returns:
      the wrapped EntityGroup
    • mutableMap

      public static <K, V> Map<K,V> mutableMap(arc.struct.ObjectMap<K,V> map)
      Wraps an ObjectMap into a Map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map - the arc map
      Returns:
      the wrapped ObjectMap
    • immutableMap

      public static <K, V> Map<K,V> immutableMap(arc.struct.ObjectMap<K,V> map)
      Wraps an ObjectMap into an immutable Map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map - the arc map
      Returns:
      the wrapped ObjectMap