jetweb is hosted by Hepforge, IPPP Durham

cedar.jetweb.model
Class Collision

java.lang.Object
  extended by cedar.jetweb.model.Collision
All Implemented Interfaces:
Storeable

public class Collision
extends java.lang.Object
implements Storeable

A collision describes a set of colliding beams & their energies.

Version:
$Date: 2006-06-01 16:42:20 +0100 (Thu, 01 Jun 2006) $ $Revision: 1172 $
Author:
Jon Butterworth

Constructor Summary
Collision()
          Create an empty collision.
Collision(int id)
          Create a collision from a unique collision ID.
 
Method Summary
 void addParticle(Particle p)
           
 Collision addParticle(Particle p, java.lang.Integer pNumber)
           
 boolean equals(java.lang.Object obj)
          Override the Object equals method.
static java.util.Enumeration<Collision> getAll()
          Returns a list of all valid Collisions in the database.
 double getCMEnergy()
          Gets beam centre-of-mass energy
 int getId()
          Get the unique ID of the object
 java.lang.Integer getNumberOfParticles()
           
 Particle getParticle1()
           
 Particle getParticle2()
           
 java.util.Collection<Particle> getParticles()
           
 int hashCode()
           
 boolean retrieve()
          Populate the object in memory from the database.
 void setId(int id)
           
 boolean store()
          Write the object in memory to the database.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Collision

public Collision(int id)
          throws JetWebException
Create a collision from a unique collision ID.

Throws:
JetWebException


Collision

public Collision()
Create an empty collision.

Method Detail

addParticle

public Collision addParticle(Particle p,
                             java.lang.Integer pNumber)
                      throws JetWebException
Throws:
JetWebException

addParticle

public void addParticle(Particle p)
                 throws JetWebException
Throws:
JetWebException

getParticles

public java.util.Collection<Particle> getParticles()

getNumberOfParticles

public java.lang.Integer getNumberOfParticles()

setId

public void setId(int id)

getParticle1

public Particle getParticle1()

getParticle2

public Particle getParticle2()

equals

public boolean equals(java.lang.Object obj)
Override the Object equals method. Use the processId.

Overrides:
equals in class java.lang.Object


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getId

public int getId()
Description copied from interface: Storeable
Get the unique ID of the object

Specified by:
getId in interface Storeable


retrieve

public boolean retrieve()
                 throws JetWebException
Description copied from interface: Storeable
Populate the object in memory from the database. Return true if the information retrieved is up to date.

Specified by:
retrieve in interface Storeable
Throws:
JetWebException


store

public boolean store()
              throws JetWebException
Description copied from interface: Storeable
Write the object in memory to the database. If the ID does not exist in the DB the object is inserted as a new entry. If the ID exists, that entry is updated.

Specified by:
store in interface Storeable
Returns:
true if the object was inserted, false otherwise.
Throws:
JetWebException


getCMEnergy

public double getCMEnergy()
Gets beam centre-of-mass energy

Returns:
ecms


getAll

public static java.util.Enumeration<Collision> getAll()
Returns a list of all valid Collisions in the database.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object