javax.media
类 MediaLocator

java.lang.Object
  继承者 javax.media.MediaLocator
所有已实现的接口:
java.io.Serializable

public class MediaLocator
extends java.lang.Object
implements java.io.Serializable

MediaLocator describes the location of media content. MediaLocator is closely related to URL. URLs can be obtained from MediaLocators, and MediaLocators can be constructed from URL. Unlike a URL, a MediaLocator can be instanced without a URLStreamHandler installed on the System.

另请参见:
URL, URLStreamHandler, 序列化表格

构造方法摘要
MediaLocator(java.lang.String locatorString)
           
MediaLocator(java.net.URL url)
           
 
方法摘要
 java.lang.String getProtocol()
          Get the beginning of the locator string up to but not including the first colon.
 java.lang.String getRemainder()
          Get the MediaLocator string with the protocol removed.
 java.net.URL getURL()
          Get the URL associated with this MediaLocator.
 java.lang.String toExternalForm()
          Create a string from the URL argument that can be used to construct the MediaLocator.
 java.lang.String toString()
          Used for printing MediaLocators.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

MediaLocator

public MediaLocator(java.net.URL url)
参数:
url - The URL to construct this media locator from.

MediaLocator

public MediaLocator(java.lang.String locatorString)
方法详细信息

getURL

public java.net.URL getURL()
                    throws java.net.MalformedURLException
Get the URL associated with this MediaLocator.

抛出:
java.net.MalformedURLException

getProtocol

public java.lang.String getProtocol()
Get the beginning of the locator string up to but not including the first colon.

返回:
The protocol for this MediaLocator.

getRemainder

public java.lang.String getRemainder()
Get the MediaLocator string with the protocol removed.

返回:
The argument string.

toString

public java.lang.String toString()
Used for printing MediaLocators.

覆盖:
java.lang.Object 中的 toString
返回:
A string for printing MediaLocators.

toExternalForm

public java.lang.String toExternalForm()
Create a string from the URL argument that can be used to construct the MediaLocator.

返回:
A string for the MediaLocator.