Package jsl.observers
Interface ObservableIfc
-
- All Known Implementing Classes:
AbstractMovementController,AbstractMover,AbstractRG2DMover,ActionSchedule,Aggregatable,Aggregate,AggregateCounter,AggregateTimeWeightedVariable,Assign,AssignAttributes,AveragePerTimeWeightedVariable,BedWard,ChooseBetweenThreeStations,ChooseBetweenTwoStations,Component,Component.Available,Component.ComponentState,Component.Created,Component.Failed,Component.Operating,Component.Repairing,Component.Unavailable,ComponentAssembly,ComponentStateChangeListener,CompositeEntityReceiver,CompositeEntityReceiver.Exit,ContinuousReviewPolicyrQ,Counter,DataObservable,DataObservableArray,Delay,Delay,DelayStation,DLQTimedUpdateDemo,DriverLicenseBureau,DriverLicenseBureauWithQ,DriverLicenseBureauWithQJ8,DriverLicenseBureauWithResource,DriverLicenseBureauWithResourceSet,DriveThroughPharmacy,DTPFunctionalTest,DTPQueueModel,DTPQueueResourceModelWithFailures,DTPQueueResourceModelWithFailuresAndSchedule,DTPQueueResourcePoolModel,DTPQueueResourcePoolWithQModel,EntityGenerator,EntityProcessGenerator,EntityReceiver,EntityType,Euclidean2DPlane,EuclideanStepBasedMovementController,EventGenerator,EventGeneratorCPP,EventGeneratorDemo,ExampleModelElement,Executive,Executive.EventExecutionProcess,FailureProcess,FastFoodRestaurant,GGCQueuingStation,GGCQueuingStationWithCustST,GreatCircleBasedSpatialModel,HospitalWard,HospitalWard,IPBisectionRootFinder,IPRootFinder,IterativeDataObservable,IterativeProcess,JobGenerator,JobShop,JobType,LevelResponse,LKInventoryModel,LOTR,MachineRepair,MacroCommand,MetropolisHastings1D,MetropolisHastingsMV,MobileResource,Model,ModelElement,ModelElementState,Mover,NHPDriverLicenseBureauWithQ,NHPPEventGenerator,NHPPTimeBtwEventRV,NWayByChanceEntitySender,NWayByChanceQObjectSender,NWayByChanceStationSender,ObservableComponent,OperatingRoom,ProcessCommand,ProcessDescription,Queue,QueueingSystemWithQ,RandomElement,RandomList,RandomMover,RandomVariable,Record,RectangularGridModel,RectangularGridSpatialModel2D,Release,ReleaseResources,Resource,ResourcedActivity,ResourceLocation,ResourcePool,ResourcePoolExample1,ResourcePoolExample2,ResourcePoolExample3,ResourcePoolWithQ,ResourceProvider,ResourceSet,ResourceSingleFailureEvent,ResourceTester,ResourceUnit,ResourceUnitExample1,ResourceUnitExample2,ResourceUnitExample3,ResourceUnitExample4,ResourceUnitExample5,ResponseInterval,ResponseSchedule,ResponseVariable,ResponseVariableAverageObserver,ResponseVariableBatchingElement,RG2DMover,Schedule,SchedulingElement,SchedulingEventExamples,Seize,SeizeResources,Sequence,SharedResource,SimplePoissonProcess,Simulation,Simulation.ReplicationExecutionProcess,SingleFailureEvent,SingleQueueStation,SingleServerStation,SpatialModel,SpatialModelElement,SpatialResource,SQSeize,SQSRWorkStation,SResource,Station,StatisticalBatchingElement,StochasticApproximationRootFinder,TandemQueue,TandemQueue,Terminate,TestEntityPackage.TestReceiver,TestLevelResponse,TestNHPP,TestNHPPPWConstant,TestNHPPPWConstantNonRepeat,TestNHPPPWConstantRepeat,TestNHPPPWLinear,TestNHPPPWLinearNonRepeat,TestNHPPPWLinearRepeat,TestObserverableObserver.Observable,TestResponseVariable,TestTimeWeighted,TieDyeTShirts,TieDyeTShirtsSR,TimeBasedFailure,TimedAction,TimeSharedComputerModel,TimeSharedComputerModel,TimeWeighted,Transporter,TransporterProvider,TransporterSet,TransporterUser,TransporterUserAbstract,TWBatchingElement,TwoWayByChanceEntitySender,TwoWayByChanceQObjectSender,TwoWayByChanceStationSender,UniformCellSelector,UpDownComponent,UpDownComponentV2,Variable,WelchDataFileAnalyzer,WorkStation,WorkStation
public interface ObservableIfcThe Java Observer/Observable implementation has a number of flaws. This class represents an interface for objects that can be observed. Essentially, observable objects promise the basic management of classes that implement the ObserverIfc
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddObserver(ObserverIfc observer)Allows the adding (attaching) of an observer to the observablebooleancontains(ObserverIfc observer)Returns true if the observer is already attachedintcountObservers()Returns how many observers are currently observing the observablevoiddeleteObserver(ObserverIfc observer)Allows the deletion (removing) of an observer from the observablevoiddeleteObservers()Deletes all the observers from the observable
-
-
-
Method Detail
-
addObserver
void addObserver(ObserverIfc observer)
Allows the adding (attaching) of an observer to the observable- Parameters:
observer- the observer to attach
-
deleteObserver
void deleteObserver(ObserverIfc observer)
Allows the deletion (removing) of an observer from the observable- Parameters:
observer- the observer to delete
-
contains
boolean contains(ObserverIfc observer)
Returns true if the observer is already attached- Parameters:
observer- the observer to check- Returns:
- true if attached
-
deleteObservers
void deleteObservers()
Deletes all the observers from the observable
-
countObservers
int countObservers()
Returns how many observers are currently observing the observable- Returns:
- number of observers
-
-