Package org.jitsi.impl.neomedia.control
Class AbstractControls
- java.lang.Object
-
- org.jitsi.impl.neomedia.control.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 implementControls.getControls().- Author:
- Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description AbstractControls()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetControl(String controlType)ImplementsControls.getControl(String).static ObjectgetControl(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 throughControls.getControls(); otherwise, returns null.static <T> TqueryInterface(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 ObjectqueryInterface(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.
-
-
-
Method Detail
-
getControl
public Object getControl(String controlType)
ImplementsControls.getControl(String). InvokesControls.getControls()and then looks for a control of the specified type in the returned array of controls.- Specified by:
getControlin interfacejavax.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 throughControls.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 forcontrolType- 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 togetControl(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 querycontrolType- 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 togetControl(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 querycontrolType- 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
-
-