/** * Builds a new factory using a Source to generate the metadata * @param headerSource Source generating metadata */ public BasicEventFactory(Source<H> headerSource){ this(new SourceAdapter<D, H>(headerSource)); }
@Override public void addListener(Listener<SpeechRecEventList> listener) { myRepeater.addListener(listener); }
/** * * @param a * @return */ @Override public I adapt(IndexedValue<I, ?> a) { return a.getIndex(); } }
@Override protected synchronized void addConnection(Session session) throws JMSException, URISyntaxException{ if(myConnectionContext == null || myConnectionsFlag){ return; } Destination accelValReceiver = ConnectionContext.getTopic(theAccelInputDest); myConnectionContext.addAsyncReceiver(ACCEL_VALUE_RECEIVER, session, accelValReceiver, FilteredVector3Record.class, FilteredVector3Record.SCHEMA$, new EmptyAdapter<FilteredVector3Record, FilteredVector3Record>()); Destination accelCfgSender = ConnectionContext.getTopic(theAccelConfigDest); myConnectionContext.addSender(ACCEL_CONFIG_SENDER, session, accelCfgSender, new EmptyAdapter<AccelerometerConfigRecord, AccelerometerConfigRecord>()); Destination accelPerSender = ConnectionContext.getTopic(theAccelReadDest); myConnectionContext.addSender(ACCEL_READ_PERIOD_SENDER, session, accelPerSender, new EmptyAdapter<DeviceReadPeriodRecord, DeviceReadPeriodRecord>()); myConnectionsFlag = true; }
/** * Adds an indexed item to the configuration * @param indexedProperty item to add */ public void addProperty(IndexedValue<K,ConfigProperty> indexedProperty){ if(indexedProperty == null){ throw new NullPointerException(); } K key = indexedProperty.getIndex(); ConfigProperty prop = indexedProperty.getValue(); addProperty(key, prop); }
public static Configuration<String> buildDefaultConfig(String ip){ if(ip == null){ throw new NullPointerException(); } Source<Long> ts = new DefaultTimestampSource(); Configuration<String> conf = buildDefaultConfig(); if(ip != null){ set(conf, CONF_BROKER_IP, ip); } return conf; }
/** * Forward an event to several listeners * @param event event to forward */ @Override public void handleEvent(E event) { notifyListeners(event); } }
/** * Builds a fresh DefaultPlayableNotifier */ public DefaultPlayableNotifier(){ myNotifier = new DefaultNotifier<T>(); }
/** * Strips the index off an IndexedValue * @param a an IndexedValue * @return the value */ @Override public V adapt(IndexedValue<?, V> a) { return a.getValue(); } }
/** * Initializes a property with type and value * @param valueClass type of the property * @param value value of the property */ public ReadOnlyProperty(Class<V> valueClass, V value) { if(valueClass == null){ throw new NullPointerException(); } myValueClass = valueClass; mySource = new DefaultSource<V>(value); }
private static Adapter<List<ServiceReference>, List<Reference>> getRefListAdapter(){ if(theRefListAdapter == null){ theRefListAdapter = new BatchAdapter(OSGiReference.getReferenceAdapter()); } return theRefListAdapter; } private static Adapter<List<ServiceReference>, List<Reference>> theRefListAdapter;
/** * Receives an array of events and notifies for each one * @param event */ @Override public void handleEvent(T[] event) { for(T t : event){ notifyListeners(t); } } }
@Override public void removeListener(Listener<SpeechRecEventList> listener) { myRepeater.removeListener(listener); }
/** * Receives a List of events and notifies for each one * @param event collection of events */ @Override public void handleEvent(List<T> event) { for(T t : event){ notifyListeners(t); } } }
/** * Receives a collection of events and notifies for each one * @param event collection of events */ @Override public void handleEvent(Iterable<T> event) { for(T t : event){ notifyListeners(t); } }
public SpeechRecEngine(){ myRepeater = new Repeater(); }
/** * Builds an empty IteratorNode */ public IteratorNode(){ IteratingNotifier<T> in = new IteratingNotifier<T>(); myListener = new ConditionalListener<List<T>>(this, in); myNotifier = new ConditionalNotifier<T>(this, in); }
@Override public void notifyListeners(SpeechRecEventList e) { myRepeater.notifyListeners(e); } }
/** Creates new form ConversationInputPanel */ public ConversationInputPanel() { initComponents(); myNotifier = new DefaultNotifier<String>(); }
/** * Sets the Source generating the metadata * @param headerSource Source generating metadata */ public void setHeaderSource(Source<H> headerSource){ if(headerSource == null){ myHeaderFactory = null; }else{ myHeaderFactory = new SourceAdapter<D, H>(headerSource); } }