public ProgramEventImpl( String programName, String serviceName, Date startTime, Date endTime, ServiceInformationType siType, ContentRatingAdvisory rating, Date updatedTime) { this.programName = programName; this.serviceName = serviceName; this.startTime = startTime; this.endTime = endTime; this.siType = siType; this.updatedTime = updatedTime; this.rating = rating; try { String locatorStr = LocatorImpl.ProgramEventProtocol + programName + LocatorImpl.ServiceProtocol + serviceName; this.locator = LocatorFactory.getInstance().createLocator(locatorStr); } catch (Exception e) {; } }
/** * Returns the Service this program event is associated with. * * @return The Service this program is delivered on. */ public Service getService() { try { String str = LocatorImpl.ServiceProtocol + serviceName; Locator serviceLoc = LocatorFactory.getInstance().createLocator(str); return ((SIManagerImpl) SIManagerImpl.createInstance()).getService(serviceLoc); } catch (Exception e) { e.printStackTrace(); } return null; }
/** * Gets the complete Locator of this SI Element. Each SI Element (such as BroadcastService, * ProgramEvent, etc.) in the MPEG-2 domain is identified by a Locator. This identification is * encapsulated by the Locator object which may use a URL format, specific MPEG numbers, such as * network ID, etc., or other mechanisms. * * @return Locator representing this SI Element */ @Override public Locator getLocator() { if (locator == null) { try { this.locator = LocatorFactory.getInstance() .createLocator(LocatorImpl.TransportStreamProtocol + description); } catch (Exception e) {; } } return this.locator; }