Class AbstractControls

  • All Implemented Interfaces:
    javax.media.Controls
    Direct Known Subclasses:
    AbstractPullBufferStream, AbstractPushBufferStream, ControlsAdapter

    public abstract class AbstractControls
    extends Object
    implements javax.media.Controls
    Provides an abstract implementation of Controls which facilitates implementers by requiring them to only implement Controls.getControls().
    Author:
    Lyubomir Marinov
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Object getControl​(String controlType)
      Implements Controls.getControl(String).
      static Object getControl​(javax.media.Controls controlsImpl, String controlType)
      Gets the control of a specific Controls implementation of a specific type if such a control is made available through Controls.getControls(); otherwise, returns null.
      static <T> T queryInterface​(javax.media.Controls controlsImpl, Class<T> controlType)
      Returns an instance of a specific Class which is either a control of a specific Controls implementation or the Controls implementation itself if it is an instance of the specified Class.
      static Object queryInterface​(javax.media.Controls controlsImpl, String controlType)
      Returns an instance of a specific Class which is either a control of a specific Controls implementation or the Controls implementation itself if it is an instance of the specified Class.
      • Methods inherited from interface javax.media.Controls

        getControls
    • Constructor Detail

      • AbstractControls

        public AbstractControls()
    • Method Detail

      • getControl

        public Object getControl​(String controlType)
        Implements Controls.getControl(String). Invokes Controls.getControls() and then looks for a control of the specified type in the returned array of controls.
        Specified by:
        getControl in interface javax.media.Controls
        Parameters:
        controlType - a String value naming the type of the control of this instance to be retrieved
        Returns:
        an Object which represents the control of this instance with the specified type
      • getControl

        public static Object getControl​(javax.media.Controls controlsImpl,
                                        String controlType)
        Gets the control of a specific Controls implementation of a specific type if such a control is made available through Controls.getControls(); otherwise, returns null.
        Parameters:
        controlsImpl - the implementation of Controls which is to be queried for its list of controls so that the control of the specified type can be looked for
        controlType - a String value which names the type of the control to be retrieved
        Returns:
        an Object which represents the control of controlsImpl of the specified controlType if such a control is made available through Controls#getControls(); otherwise, null
      • queryInterface

        public static <T> T queryInterface​(javax.media.Controls controlsImpl,
                                           Class<T> controlType)
        Returns an instance of a specific Class which is either a control of a specific Controls implementation or the Controls implementation itself if it is an instance of the specified Class. The method is similar to getControl(Controls, String) in querying the specified Controls implementation about a control of the specified Class but is different in looking at the type hierarchy of the Controls implementation for the specified Class.
        Parameters:
        controlsImpl - the Controls implementation to query
        controlType - the runtime type of the instance to be returned
        Returns:
        an instance of the specified controlType if such an instance can be found among the controls of the specified controlsImpl or controlsImpl is an instance of the specified controlType; otherwise, null
      • queryInterface

        public static Object queryInterface​(javax.media.Controls controlsImpl,
                                            String controlType)
        Returns an instance of a specific Class which is either a control of a specific Controls implementation or the Controls implementation itself if it is an instance of the specified Class. The method is similar to getControl(Controls, String) in querying the specified Controls implementation about a control of the specified Class but is different in looking at the type hierarchy of the Controls implementation for the specified Class.
        Parameters:
        controlsImpl - the Controls implementation to query
        controlType - the runtime type of the instance to be returned
        Returns:
        an instance of the specified controlType if such an instance can be found among the controls of the specified controlsImpl or controlsImpl is an instance of the specified controlType; otherwise, null