Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Could you write code for DLLImp.java DLLCompImp.java TimeSeriesImp.java NumericTimeSeriesImp.javaStockHistoryImp.java BST . java StockHistoryDataSetImp.java StockDataLoaderImp.java StockDataSetAnalyzerImp.java Without using java collection or any data structure library 2
Could you write code for
DLLImp.java
DLLCompImp.java
TimeSeriesImp.java NumericTimeSeriesImp.javaStockHistoryImp.java
BSTjava StockHistoryDataSetImp.java
StockDataLoaderImp.java StockDataSetAnalyzerImp.java
Without using java collection or any data structurelibrary
InterfaceDLL
This isthe interfaceofadoublylinkedlistseeninclass, augmentedwiththemethodsize. Implementthis
interfaceintheclassDLLImp.
Interface representing a doubly linked list.
public interface DLL
Returns the number of elements in the list.
int size;
Returns true if the list is empty, false otherwise.
boolean empty;
Returns true if the current position is at the last element, false otherwise.
boolean last;
Returns true if the current position is at the first element, false
otherwise.
boolean first;
Sets the current position to the first element of the list detailed
specification seen in class
void findFirst;
Advances the current position to the next element in the list detailed
specification seen in class
void findNext;
Moves the current position to the previous element in the list detailed
specification seen in class
void findPrevious;
Retrieves the element at the current position.
T retrieve;
Updates the element at the current position with the provided value.
void updateT val;
Inserts the provided element at the current position in the list detailed
specification seen in class
void insertT val;
Removes the element at the current position from the list detailed
specification seen in class
void remove;
InterfaceDLLComp
This is the interfaceof adoubly linked listwithcomparabledata. Implement this interface inthe class
DLLCompImpRequiresChapteronSorting
A DLL where data is comparable.
public interface DLLComp extends DLL
Requires Chapter on Sorting Sorts the list. The parameter "increasing"
indicates whether the sort is done in increasing or decreasing order.
void sortboolean increasing;
Returns the maximum element. The list must not be empty.
T getMax;
Returns the maximum element. The list must not be empty.
T getMin;
ClassPair
Agenericclassusedtostoreapairofobjectsdonotmodify
Class used to store a pair of elements.
public class Pair
public U first;
CSC Project
public V second;
public PairU first, V second
this.first first;
this.second second;
@Override
public String toString
return first.toString second.toString;
ClassCompPair
Agenericclassusedtostoreapairofobjects.Thepairiscomparableonthesecondelementdonotmodify
Class used to store a pair of elements that is comparable on the second element.
public class CompPair extends Pair implements Comparable
CompPair
public CompPairU first, V second
superfirst second;
@Override
public int compareToCompPair other
return this.second.compareToothersecond;
ClassDataPoint
Agenericclassthatrepresentsadatapointdonotmodify
import java.text.SimpleDateFormat;
import java.util.Date;
Represents a single data point in a time series. Each data point consists of a date and
a corresponding value.
public class DataPoint
The date of the data point.
public Date date;
The value of the data point.
public T value;
public DataPointDate date, T value
this.date date;
this.value value;
@Override
public String toString
SimpleDateFormat dateFormat newSimpleDateFormatyyyyMMdd;
return dateFormat.formatdate: value.toString;
InterfaceTimeSeries
Agenericinterfacethatrepresentsatimeseries. ImplementthisinterfaceintheclassTimeSeriesImp.
import java.util.Date;
Interface representing a time series of data points.
public interface TimeSeries
Returns the number of elements in the time series.
int size;
Returns true if the time series is empty, false otherwise.
Interface StockHistoryDataSet
An interface that represents the stock histories of several companies. Implement this interface in the class
Sto boolean empty;
Retrieves the data corresponding to a specific date. This method returns the
data point for the specified date, or null if no such data point exists.
T getDataPointDate date;
Return all dates in increasing order.
DLL getAllDates;
Returns min date. Time series must not be empty.
Date getMinDate;
Returns max date. Time series must not be empty.
Date getMaxDate;
Adds a new data point to the time series. If successful, the method returns
true. If date already exists, the method returns false.
boolean addDataPointDataPoint dataPoint;
Updates a data point. This method returns true if the date exists and the
update was successful, false otherwise.
boolean updateDataPointDataPoint dataPoin
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started