Skip to content
David Ray edited this page Jun 8, 2015 · 28 revisions

The term Sensor means to "go out and get information, or a conduit through which information is received".

Sensors in HTM.java are "Network reception or retrieval objects". They come in 4 flavors; only 3 of which are of any concern to a user, the fourth (HTMSensor) is a wrapper around the other three - which is HTM Network aware. These are:

  • FileSensor - Attaches to a file source specified by a path, and reads in CSV data, line by line.
  • URISensor - Connects to a URL, and reads in CSV data line by line.
  • ObservableSensor - Created by passing in a Publisher which can be programmatically fed CSV data, line by line.

Sensors are general data retrieval mechanisms and could potentially be used outside of the NAPI framework. A Decorator-Pattern is used with them to wrap them in an HTMSensor which grants it HTM Network awareness and transforms the Stream into an HTM specific source of data (i.e. The Header retrievable from the HTMSensor must be 3 lines long to support HTM Network specific headers).