Class GeneralDataView2D

  • All Implemented Interfaces:
    IDataView

    public class GeneralDataView2D
    extends java.lang.Object
    implements IDataView
    A general 2D view that presents all Objects in a Space2D to the observer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean dirty
      Flag whether the view needs updating
      protected java.lang.Object monitor
      Internal lock
      protected java.lang.Object[] objects
      The current objects
      protected Space2D space
      The space the view is connected to
    • Constructor Summary

      Constructors 
      Constructor Description
      GeneralDataView2D()
      Creates a general 2D view that presents all Objects in a Space2D to the observer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] getObjects()
      Returns a list of objects in this view
      java.lang.String getType()
      Returns the type of the view.
      void init​(IEnvironmentSpace space, java.util.Map props)
      Init the space.
      void update​(IEnvironmentSpace space)
      Updates the view.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • space

        protected Space2D space
        The space the view is connected to
      • objects

        protected java.lang.Object[] objects
        The current objects
      • dirty

        protected boolean dirty
        Flag whether the view needs updating
      • monitor

        protected java.lang.Object monitor
        Internal lock
    • Constructor Detail

      • GeneralDataView2D

        public GeneralDataView2D()
        Creates a general 2D view that presents all Objects in a Space2D to the observer.
    • Method Detail

      • getType

        public java.lang.String getType()
        Returns the type of the view.
        Specified by:
        getType in interface IDataView
        Returns:
        type of the view
      • getObjects

        public java.lang.Object[] getObjects()
        Returns a list of objects in this view
        Specified by:
        getObjects in interface IDataView
        Returns:
        list of objects
      • update

        public void update​(IEnvironmentSpace space)
        Updates the view.
        Specified by:
        update in interface IDataView
        Parameters:
        space - the space of the view