home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2001 December / dppcpro1201.iso / Extras / maple / Viewer / WebEQ / MMLViewerInstall.cab / MMLViewerApplet.cab / webeq3 / constants / OperatorProperty.class (.txt) < prev    next >
Encoding:
Java Class File  |  2001-05-24  |  2.3 KB  |  145 lines

  1. package webeq3.constants;
  2.  
  3. public class OperatorProperty implements PropertyConstants {
  4.    public boolean large;
  5.    public boolean stretchy;
  6.    public boolean movescripts;
  7.    public boolean symmetric;
  8.    public boolean accent;
  9.    public boolean binaryop;
  10.    public boolean l_fence;
  11.    public boolean r_fence;
  12.    public int lspace;
  13.    public int rspace;
  14.    public double minsize;
  15.    public double maxsize;
  16.    public int precedence;
  17.    public int fencetype;
  18.  
  19.    public OperatorProperty() {
  20.       this.large = false;
  21.       this.stretchy = false;
  22.       this.movescripts = false;
  23.       this.symmetric = true;
  24.       this.accent = true;
  25.       this.binaryop = false;
  26.       this.l_fence = false;
  27.       this.r_fence = false;
  28.       this.lspace = 0;
  29.       this.rspace = 0;
  30.       this.minsize = (double)0.0F;
  31.       this.maxsize = (double)10000.0F;
  32.       this.precedence = 0;
  33.       this.fencetype = 0;
  34.    }
  35.  
  36.    public OperatorProperty(int var1, int var2, int var3) {
  37.       this.large = false;
  38.       this.stretchy = false;
  39.       this.movescripts = false;
  40.       this.symmetric = true;
  41.       this.accent = true;
  42.       this.binaryop = false;
  43.       this.l_fence = false;
  44.       this.r_fence = false;
  45.       this.lspace = 0;
  46.       this.rspace = 0;
  47.       this.minsize = (double)0.0F;
  48.       this.maxsize = (double)10000.0F;
  49.       this.precedence = 0;
  50.       this.fencetype = 0;
  51.       this.lspace = var2;
  52.       this.rspace = var3;
  53.       this.large = (var1 & 1) != 0;
  54.       this.stretchy = (var1 & 2) != 0;
  55.       this.movescripts = (var1 & 4) != 0;
  56.       this.symmetric = (var1 & 8) != 0;
  57.       this.accent = (var1 & 16) != 0;
  58.       this.l_fence = (var1 & 32) != 0;
  59.       this.r_fence = (var1 & 64) != 0;
  60.    }
  61.  
  62.    public OperatorProperty(int var1, int var2, int var3, int var4) {
  63.       this(var1, var2, var3);
  64.       this.precedence = var4;
  65.    }
  66.  
  67.    public OperatorProperty(int var1, int var2, int var3, boolean var4, int var5) {
  68.       this(var1, var2, var3, var4);
  69.       this.precedence = var5;
  70.    }
  71.  
  72.    public OperatorProperty(int var1, int var2, int var3, boolean var4) {
  73.       this.large = false;
  74.       this.stretchy = false;
  75.       this.movescripts = false;
  76.       this.symmetric = true;
  77.       this.accent = true;
  78.       this.binaryop = false;
  79.       this.l_fence = false;
  80.       this.r_fence = false;
  81.       this.lspace = 0;
  82.       this.rspace = 0;
  83.       this.minsize = (double)0.0F;
  84.       this.maxsize = (double)10000.0F;
  85.       this.precedence = 0;
  86.       this.fencetype = 0;
  87.       this.lspace = var2;
  88.       this.rspace = var3;
  89.       this.large = (var1 & 1) != 0;
  90.       this.stretchy = (var1 & 2) != 0;
  91.       this.movescripts = (var1 & 4) != 0;
  92.       this.symmetric = (var1 & 8) != 0;
  93.       this.accent = (var1 & 16) != 0;
  94.       this.binaryop = var4;
  95.       this.l_fence = (var1 & 32) != 0;
  96.       this.r_fence = (var1 & 64) != 0;
  97.    }
  98.  
  99.    public boolean isRFence() {
  100.       return this.r_fence;
  101.    }
  102.  
  103.    public boolean isLFence() {
  104.       return this.l_fence;
  105.    }
  106.  
  107.    public OperatorProperty copy() {
  108.       OperatorProperty var1 = new OperatorProperty();
  109.       var1.lspace = this.lspace;
  110.       var1.rspace = this.rspace;
  111.       var1.large = this.large;
  112.       var1.stretchy = this.stretchy;
  113.       var1.movescripts = this.movescripts;
  114.       var1.symmetric = this.symmetric;
  115.       var1.accent = this.accent;
  116.       var1.binaryop = this.binaryop;
  117.       var1.l_fence = this.l_fence;
  118.       var1.r_fence = this.r_fence;
  119.       var1.precedence = this.precedence;
  120.       return var1;
  121.    }
  122.  
  123.    public String toString() {
  124.       if (this.l_fence && this.r_fence) {
  125.          return "A_FENCE";
  126.       } else if (this.l_fence) {
  127.          return "L_FENCE";
  128.       } else {
  129.          return this.r_fence ? "R_FENCE" : "OP";
  130.       }
  131.    }
  132.  
  133.    public static String formToString(int var0) {
  134.       if (var0 == 0) {
  135.          return "UNKNOWN";
  136.       } else if (var0 == 1) {
  137.          return "INFIX";
  138.       } else if (var0 == 2) {
  139.          return "PREFIX";
  140.       } else {
  141.          return var0 == 3 ? "POSTFIX" : "???";
  142.       }
  143.    }
  144. }
  145.