For Installation https://github.com/Benitk/OOP-Assignment-One/wiki/Installation
Ben Itzhak
Shani Cohen
The project focus on functions of type y=f(x), where both y and x are real numbers. and has four main Classes.
- Monom - represents a simple “Monom” of shape a*x^b, where a is a real number and b Is an integer (b is only positive).
- Polynom - represents an collections of Monoms.
- ComplexFunction - represents a complex function of type y=g(f1(x), f2(x)), where both f1, f2 are functions (or complex functions), y and x are real numbers and g is an operation: plus, mul, div, max, min, comp (f1(f2(x))). implantation by inner Node class to create a tree of function and operations.
- Function_GUI - represents an collections of functions (Monon, Polynom, ComplexFunction).
- Derivative – Derivative of monom
- f – Compute the value of the monom on a given x – f(x)
- Add – Add two monoms
- Multiply - Multiply two monoms
- toString – Return a string of the monom
- equals – Compare monom to an object and return true if both equal else false
- isZero – Check if the Monom has coefficient of 0
- initFromString - Creating an new object for Monom from string
- copy - Creating deep copy of the Monom object
- Derivative – Derivative of polynom
- f – Compute the value of the polynom on a given x – f(x)
- Add – Add two polynoms
- Add – Add monom with polynom
- Substract = Substract two polynoms
- Multiply - Multiply two polynoms
- Multiply - Multiply monom with polynom
- toString – Return a string of the polynom
- equals – Compare polynom to an object and return true if both equal else false
- isZero – Check if the every monom in the polynom has coefficient of zero or size of the polynom is zero
- root – Calculate the point of intersection approximately epsilon between two points
- copy – Create a copy of the polynom object
- area – Calculate the area between two point of the polynom in epsilon steps
- iteretor – Create an iterator to the polynom
- initFromString - Creating an new object for Polynom from string
- toString – Return a string of the ComplexFunction
- f – Compute the value of the polynom on a given x – f(x): f
- equals – Compare polynom to an object and return true if both equal else false
- initFromString - Creating an new object for ComplexFunction from string
- copy - Creating deep copy of the ComplexFunction object
- plus - Add to this complex_function a function
- mul - Multiply to this complex_function a function
- max - Computes the maximum over this complex_function and a function
- min - Computes the minimum over this complex_function and a function
- comp - Wrap this ComplexFunction(cf) with a function(f1) w: this.cf(f1(x))
- div - Divides to this complex_function the f1 function
- left - Returns the left side of the complex function - this side should always exists.
- right - Returns the right side of the complex function - this side might not exists (aka equals null)
- getOp - The complex_function oparation: plus, mul, div, max, min, comp
- initFromFile - Init a new collection of functions from a file using scanner to read the file
- saveToFile - Write a new collection of functions to a file using File, FileWriter
- drawFunctions - Draws all the functions in the collection in a GUI window using the given parameters using StdDraw for drawing
- drawFunctions(String json_file) - Draws all the functions in the collection in a GUI window using the given JSON file using external Gson.jar and StdDraw for drawing
- size - Returns the number of elements in this list
- isEmpty - Returns true if this list contains no elements
- contains -Returns true if this list contains the specified element
- iterator - Returns an iterator over the elements in this list in proper sequence
- toArray - Returns an array containing all of the elements in this list in proper sequence (from first to last element)
- toArray(T[] a) - Returns an array containing all of the elements in this list in proper sequence (from first to last element)
- add - Appends the specified element to the end of this list
- remove - Removes the first occurrence of the specified element from this list, if it is present
- containsAll - Returns true if this collection contains all of the elements in the specified collection
- addAll - Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's Iterator
- removeAll - Removes from this list all of its elements that are contained in the specified collection
- retainAll - Retains only the elements in this list that are contained in the specified collection
- clear - Removes all of the elemets from this list