com.bramosystems.oss.player.core.client.playlist
Class MRL

java.lang.Object
  extended by com.bramosystems.oss.player.core.client.playlist.MRL

public class MRL
extends java.lang.Object

Media Resource Locator that holds multiple alternative URLs of the same media resource (probably in different formats).

Since:
1.3
Author:
Sikiru Braheem

Constructor Summary
MRL()
          Constructs MRL object
MRL(java.util.List<java.lang.String> urls)
          Constructs MRL object with the specified URLs
MRL(java.lang.String... urls)
          Constructs MRL object with the specified URLs
MRL(java.lang.String name, java.lang.String author)
          Constructs MRL object with the specified name and author
 
Method Summary
 void addURL(java.lang.String... urls)
          Adds the specified URLs to this locator
 java.lang.String getAuthor()
          Returns the author of the media resource
 java.lang.String getCurrentResource()
          Return the current URL.
 java.lang.String getName()
          Returns a descriptive name of the media resource
 java.lang.String getNextResource(boolean roll)
          Returns the next alternative URL of the media
 java.lang.String getResource(int index)
          Returns the resource URL at the specified index
 int getResourceCount()
          Returns the number of URLs in this locator
 void setAuthor(java.lang.String author)
          Sets the author of the media resource
 void setName(java.lang.String name)
          Assigns a descriptive name for the media resource
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MRL

public MRL()
Constructs MRL object


MRL

public MRL(java.lang.String name,
           java.lang.String author)
Constructs MRL object with the specified name and author

Parameters:
name - the descriptive name of the media resource
author - the author of the media resource

MRL

public MRL(java.lang.String... urls)
Constructs MRL object with the specified URLs

Parameters:
urls - URLs of the media

MRL

public MRL(java.util.List<java.lang.String> urls)
Constructs MRL object with the specified URLs

Parameters:
urls - URLs of the media
Method Detail

addURL

public void addURL(java.lang.String... urls)
Adds the specified URLs to this locator

Parameters:
urls - URLs of the media

getNextResource

public java.lang.String getNextResource(boolean roll)
Returns the next alternative URL of the media

Parameters:
roll - true if an end-of-list should roll over to the first URL
Returns:
the next alternative URL of the media
Throws:
java.lang.IndexOutOfBoundsException - if end-of-list is reached and roll is false

getCurrentResource

public java.lang.String getCurrentResource()
Return the current URL. The current URL is that returned by the last getNextResource(boolean) method call

Returns:
the current URL

getResourceCount

public int getResourceCount()
Returns the number of URLs in this locator

Returns:
the number of URLs in this locator

getResource

public java.lang.String getResource(int index)
Returns the resource URL at the specified index

Parameters:
index - the index of the required resource URL
Returns:
the resource URL
Throws:
java.lang.IndexOutOfBoundsException - if the index is out of range

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAuthor

public java.lang.String getAuthor()
Returns the author of the media resource

Returns:
the author of the media resource

setAuthor

public void setAuthor(java.lang.String author)
Sets the author of the media resource

Parameters:
author - the author of the media resource

getName

public java.lang.String getName()
Returns a descriptive name of the media resource

Returns:
a descriptive name of the media resource

setName

public void setName(java.lang.String name)
Assigns a descriptive name for the media resource

Parameters:
name - a descriptive name of the media resource


Copyright © 2009-2011. All Rights Reserved.