Class Connection<K>

  • All Implemented Interfaces:
    java.lang.Iterable<GameObject<?,​?,​?>>

    public class Connection<K>
    extends java.lang.Object
    implements java.lang.Iterable<GameObject<?,​?,​?>>
    Stores GameObjects related to key values. A connection consists of a key object, and a set of GameObjects.
    • Constructor Summary

      Constructors 
      Constructor Description
      Connection​(K key)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGameObject​(@NotNull GameObject<?,​?,​?> gameObject)
      Adds a game object.
      K getKey()
      Returns the key.
      @NotNull java.util.Iterator<GameObject<?,​?,​?>> iterator()  
      • 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 Detail

      • Connection

        public Connection​(@NotNull
                          K key)
        Creates a new instance.
        Parameters:
        key - the key
    • Method Detail

      • getKey

        @NotNull
        public K getKey()
        Returns the key.
        Returns:
        the key
      • addGameObject

        public void addGameObject​(@NotNull
                                  @NotNull GameObject<?,​?,​?> gameObject)
        Adds a game object.
        Parameters:
        gameObject - the game object to add
      • iterator

        @NotNull
        public @NotNull java.util.Iterator<GameObject<?,​?,​?>> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<K>