AP® Computer Science Marine Biology Simulation

Class DisplayMap

java.lang.Object
  |
  +--DisplayMap

public class DisplayMap
extends java.lang.Object

AP® Computer Science Marine Biology Simulation:
DisplayMap is a collection that maps environment object classes to objects that know how to display them.

The DisplayMap class is copyright© 2002 College Entrance Examination Board (www.collegeboard.com).

Version:
1 August 2002

Constructor Summary
DisplayMap()
           
 
Method Summary
static void associate(java.lang.String envObjClassname, LocatableDisplay displayObj)
          Associates a display object with an environment object class.
static LocatableDisplay findDisplayFor(Locatable obj)
          Finds a display class that knows how to display the given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayMap

public DisplayMap()
Method Detail

associate

public static void associate(java.lang.String envObjClassname,
                             LocatableDisplay displayObj)
Associates a display object with an environment object class. If no class can be found for that name, an error message is printed.
Parameters:
envObjClassname - the name of a class whose objects might be in an Environment
displayObj - object that knows how to display objects of class envObjClassname

findDisplayFor

public static LocatableDisplay findDisplayFor(Locatable obj)
Finds a display class that knows how to display the given object.
Parameters:
obj - the object to display

AP® Computer Science Marine Biology Simulation

Copyright© 2002 College Entrance Examination Board