Class PrioritySQFactory<QS extends QueueServer>

All Implemented Interfaces:
Cloneable

public abstract class PrioritySQFactory<QS extends QueueServer> extends AbstrPrioritySQFactory<PriorityServerQueue<QS>,QS>
Abstract Factory for priority server queues with the type of the queue server unspecified.

Subclasses that are not abstract should set the type parameter QS and implement the method getQueueServerClass This can be done using an anonymous class. For use in a scriptable application, a class should be defined and the fully qualified class name listed in the file org.bzdev.obnaming.NamedObjectFactory in the META-INF/services directory of the application's JAR file.

Parameters that are inherited include the following:

  • "timeline" - an integer-keyed set of values that define changes in the object's configuration. Subclasses may provide additional parameters. The default parameters are:
    • "timeline.time" - the time at which timeline parameters are to change. This parameter must be provided if a timeline entry exists. The units are those used by the double-precision time unit for the simulation (for animations, this is generally seconds).
    • "timeline.traceSetMode" - indicates how the parameter "timeline.traceSets" is interpreted. the values are enumeration constants of type TraceSetMode and are used as follows:
      • KEEP - keep the existing trace sets, adding additional ones specified by the parameter "timeline.traceSets".
      • REMOVE - remove the trace sets specified by the parameter "timeline.traceSets".
      • REPLACE - remove all existing trace sets and replace those with the ones specified by the timeline.traceSets parameter.
    • "timeline.traceSets" - a parameter representing a set of TraceSet objects (the three-argument 'add' method is used to add entries).
  • "traceSets" - a set of TraceSets a SimObject will use for tracing. One should use the add and remove factory methods as this parameter refers to a set of values.
  • "queueServer" - an instance of a the subtype QS of QueueServer. For this case, one must use the "add" method instead of the "set" method as the entry will be added to a table.
  • "deletePolicy" - an enumeration QueueDeletePolicy describing the 'delete' policy for the queue. The delete policy determines what happens when the caller deletes a queue whose length is nonzero. The values are as follows:
    • MUST_BE_EMPTY - the queue must be empty and not processing any more elements before it can be deleted.
    • WHEN_EMPTY - the queue will not accept new entries after the delete() method is called, with the actual deletion postponed until the queue is empty.
    • NEVER - the queue may not be deleted.
    The default is WHEN_EMPTY.

Subclasses that are not abstract classes must implement the method getQueueServerClass. For example,


   public class FooPrioritySQFactory extends PrioritySQFactory<Foo> {
       Class<Foo> getQueueServerClass() {returns Foo.class;}
       public FooPrioritySQFactory(Simulation sim) {
         super(sim);
       }
   }
 
would create a factory for priority server queues whose servers' class is Foo.
See Also: