Advertisement
Kslash22

ContinuousItem

Jun 24th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.81 KB | None | 0 0
  1. package mining;
  2. import data.*;
  3.  
  4. public class ContinuousItem extends Item {
  5.    
  6.     private float inf; //estremo inferiore
  7.     private float sup; //estremo superiore
  8.    
  9.     public ContinuousItem(ContinuousAttribute attribute, Interval value) {
  10.  
  11.         super(attribute,value);
  12.         this.attribute = attribute;
  13.         this.value = value;
  14.        
  15.     }
  16.    
  17.     boolean checkItemCondition(Object value) {
  18.        
  19. //      checkValueInclusion( value); mi ricorda lontanamente sto metodo di Interval, ma booooh LEL 
  20.        
  21.         float val =(float) value;//non si puo confrontare un object con valori float per cui downcasting, pero' TODO: usare float normale o classi wrapper?
  22.         if(val >= this.inf & val <= this.sup)
  23.             return true;
  24.         else
  25.             return false;
  26.        
  27.  
  28.     }
  29.    
  30.     public String toString() {
  31.  
  32.         return super.toString();
  33.         //TODO: che ne pensate? LEL
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement