- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface HTMLModifier
HTMLModifier - Documentation.
This allows a user to write a method, or a lambda expression that can take an HTML Page as a parameter (vectorized HTML) and perform any one (or all) of the following:
- Modify the HTML Elements in the news
- Clean or remove unnecessary portions of the
URL'sbefore downloading the pictures
- Insert HTML into portions of the page
- Extract salient information for internal processing
static final long serialVersionUIDThis fulfils the SerialVersion UID requirement for all classes that implement Java's
interface java.io.Serializable. Using the
SerializableImplementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Functional Interfaces are usually not thought of as Data Objects that need to be saved, stored and retrieved; however, having the ability to store intermediate results along with the lambda-functions that helped get those results can make debugging easier.
- See Also:
- Constant Field Values
- Exact Field Declaration Expression:
void modifyOrRetrieve(java.util.Vector<HTMLNode> html, java.net.URL originalPageURL, int sectionNum, int articleNum)FUNCTIONAL-INTERFACE METHOD: This is the method that must be fulfilled to meet the requirements of this
html- This is the vectorized-
originalPageURL- This is the original
URLfrom whence the page was downloaded. It is provided to this method, merely for convenience.
sectionNum- Each article that is downloaded belonged to a particular news section. News sections are listed by their position in a Java
Vector, and the index into ths
Vectoris treated as a the
'ID', or the
'number'of the section.
This value is provided here to this method just for convenience. When
'.html'files are saved (as
'.dat'files) - their save location is of the form of
'directoryName/fileName.dat'- where the
String 'directoryName'is this Section Number provided here.
articleNum- Each article that is downloaded is given a number that is merely the order of the
Articlein the download process. The 5th
Articleto be downloaded in a given / particular section would have filename
This value is provided here to this method just for convenience.