Advertisement
Guest User

Untitled

a guest
May 21st, 2018
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. package versionenif;
  2.  
  3.  
  4. enum Parameter {NAME, QUALITY, STANDART;}
  5. enum Type {NUMERICAL, CATEGORIAL, STRING ;}
  6. enum Priority{SECOND, FIRST;}
  7.  
  8. public class enumif_v2 {
  9.    
  10.     Parameter parameter;
  11.     Type type;
  12.     Priority priority;
  13.    
  14.     int nb;
  15.     String STATE = "";
  16.    
  17.     public enumif_v2(Parameter parameter, Type type, Priority priority) {
  18.         this.parameter = parameter;
  19.         this.type = type;
  20.         this.priority = priority;
  21.        
  22.     }
  23.    
  24.     public void SwitchZustand(Parameter parameter, Type type, Priority priority) {
  25.        
  26.        
  27.         if(parameter == Parameter.NAME) {
  28.                 if(type == Type.NUMERICAL) {
  29.                         parameter = Parameter.STANDART;
  30.                         if(priority == Priority.FIRST) {
  31.                             type = Type.CATEGORIAL;
  32.                         }
  33.                         if(priority == Priority.SECOND) {
  34.                             type = Type.STRING;
  35.                         }  
  36.                     }
  37.                        
  38.                 if(type == Type.CATEGORIAL) {
  39.                     parameter = Parameter.QUALITY;
  40.                 }
  41.                            
  42.                 if(type == Type.STRING) {
  43.                         parameter = Parameter.STANDART;
  44.                         if(priority == Priority.FIRST) {
  45.                             type = Type.CATEGORIAL;
  46.                                 if(STATE == "ROUND")
  47.                                     MagicThings(nb);
  48.                             }
  49.                                
  50.                             if(priority == Priority.SECOND) {
  51.                                 type = Type.STRING;
  52.                             }
  53.                            
  54.                 }
  55.                
  56.         if(parameter == Parameter.QUALITY) {
  57.                 if(type == Type.NUMERICAL) {
  58.                         if(STATE == "TRIANGLE")
  59.                             DoMagicThings(nb);
  60.                         if(priority == Priority.FIRST) {
  61.                             type = Type.STRING;
  62.                             if(STATE == "RECTANGLE")
  63.                                 DoMagicThings(nb);
  64.                            
  65.                         }
  66.                 }
  67.         }
  68.     }
  69.  
  70. }
  71.    
  72.    
  73.    
  74.    
  75.    
  76.    
  77.    
  78.  
  79.    
  80.     public void MagicThings(int parameter) {
  81.         //do some magic
  82.     }
  83.  
  84.     public void DoMagicThings(int parameter) {
  85.         //do some magic
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement