SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public boolean equals(Object other) {
  2.         if (other == Polynom.NaP || this == Polynom.NaP ){
  3.             return false;
  4.         }
  5.        
  6.         boolean eq = false;
  7.         if (other instanceof Polynom){ // hier k├Ânnte man auch this.getClass() == other.getClass()
  8.             if ((other) != null && this != null){
  9.                 if (((MapPolynom)other).degree() == this.degree()){
  10.                     int i = (int)this.degree();
  11.                     while (i>=0){
  12.                         if ( this.coeff(i) == ((MapPolynom)other).coeff(i)){
  13.                             eq = true;
  14.                             i--;
  15.                         }else{
  16.                             eq = false;
  17.                             break;
  18.                         }
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.         return eq;
  24.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top