Interface NamedObjectDatabase


  • public interface NamedObjectDatabase
    This interface defines the Java-side interface to the named object database that can be obtained from StrangeEons.getNamedObjects(). The purpose of the database is to allow plug-in scripts to share objects and communicate with each other. This interface provides a way to access these objects from compiled Java code as well.
    Since:
    3.0
    Author:
    Chris Jennings
    See Also:
    StrangeEons.getNamedObjects()
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object getObject​(java.lang.String name)
      Returns the object associated with the requested name, or null if there is no object associated with the name.
      void putObject​(java.lang.String name, java.lang.Object object)
      Associates an object with the specified name.
      void removeObject​(java.lang.String name)
      Removes the object with the requested name, if any.
    • Method Detail

      • getObject

        java.lang.Object getObject​(java.lang.String name)
        Returns the object associated with the requested name, or null if there is no object associated with the name.
        Parameters:
        name - the object name to return
        Returns:
        the value of the object in the database, or null
        Throws:
        java.lang.NullPointerException - if name is null
      • putObject

        void putObject​(java.lang.String name,
                       java.lang.Object object)
        Associates an object with the specified name. If an object with this name already exists, a warning will be logged to help diagnose naming conflicts.
        Parameters:
        name - the name of the object to return
        object - the object to associate with the name in the database
        Throws:
        java.lang.NullPointerException - if the name or object is null
        java.lang.IllegalArgumentException - if the name is already associated with an object
      • removeObject

        void removeObject​(java.lang.String name)
        Removes the object with the requested name, if any.
        Parameters:
        name - the name of the object to remove
        Throws:
        java.lang.NullPointerException - if name is null