ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.contact
Class SimpleContactFactory

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.contact.SimpleContactFactory
All Implemented Interfaces:
ContactFactory

public class SimpleContactFactory
extends Object
implements ContactFactory

This implements the ContactFactory interface to instantiate Contact objects with fixed parameters.


Constructor Summary
SimpleContactFactory()
          Constructs a new contact factory which will create contact objects with priority 1 and type ID 0.
SimpleContactFactory(double priority, int typeId, boolean tracing)
          Constructs a new contact factory which will create contact objects with priority priority and type ID typeId.
SimpleContactFactory(int typeId)
          Constructs a new contact factory which will create contact objects with priority 1 and type ID typeId.
SimpleContactFactory(Simulator sim)
          Equivalent to SimpleContactFactory(), using the given simulator sim.
SimpleContactFactory(Simulator sim, double priority, int typeId, boolean tracing)
          Equivalent to SimpleContactFactory(double,int,boolean), using the given simulator sim.
SimpleContactFactory(Simulator sim, int typeId)
          Equivalent to SimpleContactFactory(int), using the given simulator sim.
 
Method Summary
 double getPriority()
          Returns the priority of the created and reused contact objects.
 boolean getTracing()
          Returns true if the created contacts will support steps tracing.
 int getTypeId()
          Returns the type ID of the created and reused contact objects.
 Contact newInstance()
          Constructs and returns a new Contact object.
 void setSimulator(Simulator sim)
          Sets the simulator associated with this contact factory to sim.
 Simulator simulator()
          Returns the simulator associated with this contact factory.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleContactFactory

public SimpleContactFactory()
Constructs a new contact factory which will create contact objects with priority 1 and type ID 0.


SimpleContactFactory

public SimpleContactFactory(Simulator sim)
Equivalent to SimpleContactFactory(), using the given simulator sim.


SimpleContactFactory

public SimpleContactFactory(int typeId)
Constructs a new contact factory which will create contact objects with priority 1 and type ID typeId.

Parameters:
typeId - the type ID of the contacts.

SimpleContactFactory

public SimpleContactFactory(Simulator sim,
                            int typeId)
Equivalent to SimpleContactFactory(int), using the given simulator sim.


SimpleContactFactory

public SimpleContactFactory(double priority,
                            int typeId,
                            boolean tracing)
Constructs a new contact factory which will create contact objects with priority priority and type ID typeId. If tracing is true, contact objects with steps tracing enabled will be created.

Parameters:
priority - the priority of the contact.
typeId - the type ID of the contacts.
tracing - the contact steps tracing indicator.

SimpleContactFactory

public SimpleContactFactory(Simulator sim,
                            double priority,
                            int typeId,
                            boolean tracing)
Equivalent to SimpleContactFactory(double,int,boolean), using the given simulator sim.

Method Detail

simulator

public Simulator simulator()
Returns the simulator associated with this contact factory. This simulator is associated with every contact instantiated by the factory.

Returns:
the associated simulator.

setSimulator

public void setSimulator(Simulator sim)
Sets the simulator associated with this contact factory to sim.

Parameters:
sim - the new associated simulator.

getPriority

public double getPriority()
Returns the priority of the created and reused contact objects.

Returns:
the priority of the generated contact.

getTypeId

public int getTypeId()
Returns the type ID of the created and reused contact objects.

Returns:
the type ID of the generated contact.

getTracing

public boolean getTracing()
Returns true if the created contacts will support steps tracing.

Returns:
the contact steps tracing indicator.

newInstance

public Contact newInstance()
Description copied from interface: ContactFactory
Constructs and returns a new Contact object. If a contact cannot be instantiated, a ContactInstantiationException is thrown.

Specified by:
newInstance in interface ContactFactory
Returns:
the new contact object.

toString

public String toString()
Overrides:
toString in class Object

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.