org.opensha.refFaultParamDb.dao.db
Class PaleoEventDB_DAO

java.lang.Object
  extended by org.opensha.refFaultParamDb.dao.db.PaleoEventDB_DAO

public class PaleoEventDB_DAO
extends Object

Title: PaleoEventDB_DAO.java

Description: This class interacts with the database to put/get information about paleo events

Copyright: Copyright (c) 2002

Company:

Version:
1.0
Author:
not attributable

Constructor Summary
PaleoEventDB_DAO(DB_AccessAPI dbAccess)
           
 
Method Summary
 void addPaleoevent(PaleoEvent paleoEvent)
          Add a new paleo event
 int checkSameDisplacement(ArrayList<String> eventNames)
          Check whether the passed in event names share the same displacement.
 ArrayList<PaleoEvent> getAllEvents(int siteId)
          Get a list of all events for this site It returns an ArrayList of PaleoEvent objects
 PaleoEvent getEvent(int eventId)
           
 ArrayList<String> getEventNamesForDisplacement(int displacementEstId)
          Get a list of all event names sharing the given displacement estimate Id
 void setDB_Connection(DB_AccessAPI dbAccess)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaleoEventDB_DAO

public PaleoEventDB_DAO(DB_AccessAPI dbAccess)
Method Detail

setDB_Connection

public void setDB_Connection(DB_AccessAPI dbAccess)

addPaleoevent

public void addPaleoevent(PaleoEvent paleoEvent)
                   throws InsertException
Add a new paleo event

Parameters:
paleoEvent -
Throws:
InsertException

checkSameDisplacement

public int checkSameDisplacement(ArrayList<String> eventNames)
Check whether the passed in event names share the same displacement. If they share same displacement, the diplacement id is returned else -1 is returned

Parameters:
eventNames -
Returns:

getAllEvents

public ArrayList<PaleoEvent> getAllEvents(int siteId)
                                   throws QueryException
Get a list of all events for this site It returns an ArrayList of PaleoEvent objects

Parameters:
siteId -
Returns:
Throws:
QueryException

getEvent

public PaleoEvent getEvent(int eventId)
                    throws QueryException
Throws:
QueryException

getEventNamesForDisplacement

public ArrayList<String> getEventNamesForDisplacement(int displacementEstId)
                                               throws QueryException
Get a list of all event names sharing the given displacement estimate Id

Parameters:
displacementEstId -
Returns:
Throws:
QueryException