Added preliminary Uri class

Added method stubs for Media classes
This commit is contained in:
Tom Lint 2014-02-03 21:13:29 +01:00
parent ddfac52fce
commit 9335b2e748
8 changed files with 182 additions and 28 deletions

View File

@ -95,7 +95,7 @@ public final class Album implements IEquatable<Album>, IDisposable
{ {
return (obj instanceof Album) ? (this == (Album)obj) : false; return (obj instanceof Album) ? (this == (Album)obj) : false;
} }
/** /**
* Determines whether the specified Album is equal to this Album. * Determines whether the specified Album is equal to this Album.
* *
@ -133,7 +133,9 @@ public final class Album implements IEquatable<Album>, IDisposable
private void ThrowIfDisposed() private void ThrowIfDisposed()
{ {
if (this.isDisposed) if (this.isDisposed)
throw new ObjectDisposedException(super.toString(), "This object has already been disposed."); {
throw new ObjectDisposedException(this.getClass().toString(), "This object has already been disposed.");
}
} }
/** /**

View File

@ -2,6 +2,8 @@ package Microsoft.Xna.Framework.Media;
import java.util.Iterator; import java.util.Iterator;
import System.*;
/** /**
* *
* *
@ -15,27 +17,25 @@ public final class AlbumCollection implements Iterable<Album>
@Override @Override
public Iterator<Album> iterator() public Iterator<Album> iterator()
{ {
// TODO Auto-generated method stub throw new NotImplementedException();
return null;
} }
protected void finalize() protected void finalize()
{ {
} }
public int Count() public int Count()
{ {
throw new NotImplementedException();
} }
public boolean IsDisposed() public boolean IsDisposed()
{ {
throw new NotImplementedException();
} }
public Album get(int index) public Album get(int index)
{ {
throw new NotImplementedException();
} }
} }

View File

@ -3,23 +3,63 @@ package Microsoft.Xna.Framework.Media;
import System.*; import System.*;
/** /**
* Provides access to genre information in the media library.
* *
* @author Halofreak1990 * @author Halofreak1990
*/ */
public final class Genre implements IEquatable<Genre>, IDisposable public final class Genre implements IEquatable<Genre>, IDisposable
{ {
/** /**
* * Gets the AlbumCollection for the Genre.
*/
public AlbumCollection getAlbums()
{
throw new NotImplementedException();
}
/**
* Gets a value indicating whether the object is disposed.
*/
public boolean IsDisposed()
{
throw new NotImplementedException();
}
/**
* Gets the name of the Genre.
*/
public String getName()
{
throw new NotImplementedException();
}
/**
* Gets the SongCollection for the Genre.
*/
public SongCollection getSongs()
{
throw new NotImplementedException();
}
protected void finalize()
{
// TODO: implement
}
/**
* Immediately releases the unmanaged resources used by this object.
*/ */
@Override @Override
public void Dispose() public void Dispose()
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
/** /**
* Determines whether the specified Genre is equal to this Genre.
* *
* @param other
* The Genre to compare with this instance.
*/ */
@Override @Override
public boolean Equals(Genre other) public boolean Equals(Genre other)
@ -27,9 +67,12 @@ public final class Genre implements IEquatable<Genre>, IDisposable
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
/** /**
* Determines whether the specified Object is equal to this Genre.
* *
* @param obj
* The Object to compare with this instance.
*/ */
public boolean equals(Object obj) public boolean equals(Object obj)
{ {
@ -37,10 +80,10 @@ public final class Genre implements IEquatable<Genre>, IDisposable
} }
/** /**
* * Returns a String representation of the Genre.
*/ */
public String toString() public String toString()
{ {
throw new NotImplementedException();
} }
} }

View File

@ -1,5 +1,7 @@
package Microsoft.Xna.Framework.Media; package Microsoft.Xna.Framework.Media;
import System.*;
/** /**
* Provides methods and properties to access and control the queue of playing songs. * Provides methods and properties to access and control the queue of playing songs.
* *
@ -9,17 +11,17 @@ public final class MediaQueue
{ {
public Song getActiveSong() public Song getActiveSong()
{ {
throw new NotImplementedException();
} }
public int getActiveSongIndex() public int getActiveSongIndex()
{ {
throw new NotImplementedException();
} }
public int Count() public int getCount()
{ {
throw new NotImplementedException();
} }
MediaQueue() MediaQueue()
@ -28,6 +30,6 @@ public final class MediaQueue
public Song get(int index) public Song get(int index)
{ {
throw new NotImplementedException();
} }
} }

View File

@ -35,6 +35,9 @@ public final class Song implements IEquatable<Song>, IDisposable
} }
/** /**
*
*
* @param obj
* *
*/ */
@Override @Override
@ -43,6 +46,12 @@ public final class Song implements IEquatable<Song>, IDisposable
return (obj instanceof Song) ? Equals((Song)obj) : false; return (obj instanceof Song) ? Equals((Song)obj) : false;
} }
/**
*
*
* @param other
*
*/
@Override @Override
public boolean Equals(Song other) public boolean Equals(Song other)
{ {
@ -66,7 +75,7 @@ public final class Song implements IEquatable<Song>, IDisposable
*/ */
public static Song FromUri(String name, Uri uri) public static Song FromUri(String name, Uri uri)
{ {
throw new NotImplementedException();
} }
/** /**
@ -76,20 +85,23 @@ public final class Song implements IEquatable<Song>, IDisposable
@Override @Override
public int hashCode() public int hashCode()
{ {
throw new NotImplementedException();
} }
private void ThrowIfDisposed() private void ThrowIfDisposed()
{ {
if (this.isDisposed) if (this.isDisposed)
{ {
throw new ObjectDisposedException(this.toString(), "This object has already been disposed."); throw new ObjectDisposedException(this.getClass().toString(), "This object has already been disposed.");
} }
} }
/**
*
*/
@Override @Override
public String toString() public String toString()
{ {
throw new NotImplementedException();
} }
} }

View File

@ -2,6 +2,8 @@ package Microsoft.Xna.Framework.Media;
import java.util.Iterator; import java.util.Iterator;
import System.*;
/** /**
* *
* *
@ -16,17 +18,16 @@ public final class SongCollection implements Iterable<Song>
@Override @Override
public Iterator<Song> iterator() public Iterator<Song> iterator()
{ {
// TODO Auto-generated method stub throw new NotImplementedException();
return null;
} }
/** /**
* *
* @return * @return
*/ */
public int Count() public int getCount()
{ {
throw new NotImplementedException();
} }
/** /**
@ -35,7 +36,7 @@ public final class SongCollection implements Iterable<Song>
*/ */
public boolean IsDisposed() public boolean IsDisposed()
{ {
throw new NotImplementedException();
} }
/** /**
@ -53,6 +54,6 @@ public final class SongCollection implements Iterable<Song>
*/ */
public Song get(int index) public Song get(int index)
{ {
throw new NotImplementedException();
} }
} }

View File

@ -0,0 +1,71 @@
package System;
/**
* Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI.
*
* @author Halofreak1990
*/
public class Uri
{
private String uriString;
/**
* Gets a value that indicates whether the System.Uri instance is absolute.
*
* @return
* A boolean value that is true if the System.Uri instance is absolute; otherwise, false.
*/
public boolean IsAbsoluteUri()
{
throw new NotImplementedException();
}
/**
* Gets the original URI string that was passed to the System.Uri constructor.
*
* @return
* A String containing the exact URI specified when this instance was constructed; otherwise, String.Empty.
*
* @exception System.InvalidOperationException
* This instance represents a relative URI, and this property is valid only for absolute URIs.
*/
public String getOriginalString()
{
if (!this.IsAbsoluteUri())
{
throw new InvalidOperationException("");
}
return uriString;
}
public Uri(String uriString)
{
this.uriString = uriString;
}
public Uri(String uriString, boolean dontEscape)
{
this.uriString = uriString;
}
public Uri(String uriString, UriKind uriKind)
{
}
public Uri(Uri baseUri, String relativeUri)
{
}
public Uri(Uri baseUri, String relativeUri, boolean dontEscape)
{
}
public Uri(Uri baseUri, Uri relativeUri)
{
}
}

View File

@ -0,0 +1,23 @@
package System;
/**
* Defines the kinds of System.Uris for the System.Uri.IsWellFormedUriString(String,System.UriKind) and several Overload:System.Uri.#ctor methods.
*
* @author Halofreak1990
*
*/
public enum UriKind
{
/**
* The kind of the Uri is indeterminate.
*/
RelativeOrAbsolute,
/**
* The Uri is an absolute Uri.
*/
Absolute,
/**
* The Uri is a relative Uri.
*/
Relative
}