Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * for each service,
- * for each serviceID
- * if service id does not appear in array
- * stop service
- */
- public void autoStopService(int[] serviceIDs)
- {
- IService service;
- System.out.println("Size of Hashset: " + this._services.size());
- for(Enumeration e = this._services.keys(); e.hasMoreElements() ; ){
- for(int i=0; i<serviceIDs.length; i++){
- if(!this._services.contains(Integer.valueOf(serviceIDs[i]))){
- System.out.println("ServiceID: " + serviceIDs[i] + " not found" );
- continue;
- }
- System.out.println("Searching for ID: " + serviceIDs[i]);
- service = (IService)this._services.get(Integer.valueOf(i));
- if(service == null)
- {
- System.out.println("Service was null!!!!");
- continue;
- }
- System.out.println("Service ID of retrieved Service: " + service.getServiceId());
- if(service == null) {
- System.out.println("Null value");
- continue;
- }
- if(service.getServiceId() != serviceIDs[i] ) {
- this.stopService(i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement