tauZaman
v0.1

tauzaman.calendricsystem
Class CalendricSystemRepository

java.lang.Object
  |
  +--tauzaman.calendricsystem.CalendricSystemRepository

public class CalendricSystemRepository
extends java.lang.Object

CalendricSystemRepositoryr class is the entrance point of calendric systems and calendars that they contain. It forms and maintains new CalendricSystem and Calendars through a CalendarRepository. For a user to use services of tauzaman there are two main registration process. One of them is done once, which is registering to system. And the other one, is registering to a service of a particular CalendricSystem. Latter can be done for a limited number of times depending on the maximum number of different CalendricSystems that can be used.

See Also:
CalendricSystem, Calendar
Status:
design complete, implementation complete

Field Summary
private  java.util.Hashtable calendricSystems
          A Hashtable, whose keys are URLs of CalendricSystems and values are CalendricSystem handles.
private  CalendarRepository cr
          A handle to unique CalendarRepository that this CalendricSystemRepository uses.
 
Constructor Summary
CalendricSystemRepository(CalendarRepository cr)
          Constructs a Calendric System Manager and allocates memory for database of CalendricSystem.
 
Method Summary
 java.net.URL[] getAllCalendricSystemUrls()
          Returns urls of all CalendricSystems in the database.
private  CalendricSystem getCalendricSystem(java.net.URL url)
          Returns a handle to CalendricSystem in the database.
 CalendricSystem loadCalendricSystem(java.net.URL url)
          Loads a CalendricSystem, given its URL and returns a handle to loaded CalendricSystem.
 java.lang.String toString()
          Returns urls of all CalendricSystems.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

calendricSystems

private java.util.Hashtable calendricSystems
A Hashtable, whose keys are URLs of CalendricSystems and values are CalendricSystem handles.


cr

private CalendarRepository cr
A handle to unique CalendarRepository that this CalendricSystemRepository uses.

Constructor Detail

CalendricSystemRepository

public CalendricSystemRepository(CalendarRepository cr)
Constructs a Calendric System Manager and allocates memory for database of CalendricSystem.

Parameters:
cr - unique CalendarRepository that this CalendricSystemRepository uses
Method Detail

loadCalendricSystem

public CalendricSystem loadCalendricSystem(java.net.URL url)
                                    throws CalendricSystemFormationException
Loads a CalendricSystem, given its URL and returns a handle to loaded CalendricSystem. If a CalendricSystem with given URL already exists in the database, then just return a handle without further loading.

Parameters:
url - URL of CalendricSystem specification to be loaded
Returns:
a handle to loaded CalendricSystem
Throws:
CalendricSystemFormationException - if there is any problem occurs when parsing the specification file pointed by URL

getAllCalendricSystemUrls

public java.net.URL[] getAllCalendricSystemUrls()
Returns urls of all CalendricSystems in the database.

Returns:
array of URLs

getCalendricSystem

private CalendricSystem getCalendricSystem(java.net.URL url)
Returns a handle to CalendricSystem in the database. Returns null if there is no such CalendricSystem in the system.

Parameters:
url - URL of the CalendricSystem that is looked for.
Returns:
a handle to CalendricSystem found in the database.

toString

public java.lang.String toString()
Returns urls of all CalendricSystems.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of URLs

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project