aboutsummaryrefslogtreecommitdiff
path: root/Week7/src/polynomial/Term.java
diff options
context:
space:
mode:
authorCamil Staps2015-03-17 19:10:07 +0100
committerCamil Staps2015-03-17 19:10:07 +0100
commit5dca7b0f4aed3ae3ba90cdf205ca38e9269cfb37 (patch)
tree8b38d7785371d384646330dbd2d84f46d8e9696c /Week7/src/polynomial/Term.java
parentAdded MIT license w7 (diff)
Added javadoc
Diffstat (limited to 'Week7/src/polynomial/Term.java')
-rw-r--r--Week7/src/polynomial/Term.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/Week7/src/polynomial/Term.java b/Week7/src/polynomial/Term.java
index b8d9f16..7cde927 100644
--- a/Week7/src/polynomial/Term.java
+++ b/Week7/src/polynomial/Term.java
@@ -8,6 +8,9 @@ import java.util.Scanner;
* @author Sjaak Smetsers
* @version 1.0
* @date 15-02-2012
+ *
+ * @author Camil Staps, s4498062
+ * @date 17-03-2015
*/
public class Term {
@@ -94,6 +97,8 @@ public class Term {
/**
* Standard implementation of equality
+ * @param may_be_term the object to check equality with
+ * @return true iff may_be_term represents the same term as this term
*/
@Override
public boolean equals(Object may_be_term) {
@@ -106,6 +111,11 @@ public class Term {
}
}
+ /**
+ * Apply a term to a concrete variable
+ * @param x the variable to apply the term to
+ * @return the result of the application of the term to x
+ */
public double apply(double x) {
return coefficient * Math.pow(x, exponent);
}