Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.metacosm.framework.perceptions
Class MediaPool  view MediaPool download MediaPool.java

java.lang.Object
  extended byorg.metacosm.framework.perceptions.MediaPool
All Implemented Interfaces:
org.metacosm.framework.persistence.Persistent, java.io.Serializable

public final class MediaPool
extends java.lang.Object
implements org.metacosm.framework.persistence.Persistent

This class gets all different media. Access a Medium only through this class. It is a Singleton OOD pattern.


Field Summary
protected static MediaPool media_pool
          The unique instance of this class.
private  java.util.List mediaCol
          A collection of class Medium
private  int mediaNumber
          The number of Mediums in this pool
 
Constructor Summary
private MediaPool()
           
 
Method Summary
private  void addMedium(Medium medium)
           
 java.util.Collection getAll()
          Gets all media in a Collection.
static MediaPool getInstance()
           
 Sound getSound()
          A specialized method to get the 'Sound' medium
 VisibleLight getVisibleLight()
          A specialized method to get the 'Visible light' medium.
 void load(java.io.InputStream is)
          Loads from the stream.
 void save(java.io.OutputStream os)
          Saves on the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

media_pool

protected static MediaPool media_pool
The unique instance of this class.


mediaCol

private java.util.List mediaCol
A collection of class Medium


mediaNumber

private int mediaNumber
The number of Mediums in this pool

Constructor Detail

MediaPool

private MediaPool()
Method Detail

getInstance

public static MediaPool getInstance()

getAll

public java.util.Collection getAll()
Gets all media in a Collection.


getVisibleLight

public VisibleLight getVisibleLight()
A specialized method to get the 'Visible light' medium.


getSound

public Sound getSound()
A specialized method to get the 'Sound' medium


addMedium

private void addMedium(Medium medium)

load

public void load(java.io.InputStream is)
          throws java.io.IOException
Loads from the stream.

Specified by:
load in interface org.metacosm.framework.persistence.Persistent

save

public void save(java.io.OutputStream os)
          throws java.io.IOException
Saves on the stream.

Specified by:
save in interface org.metacosm.framework.persistence.Persistent