001/* 002 * To change this template, choose Tools | Templates 003 * and open the template in the editor. 004 */ 005 006package com.nativelibs4java.opencl.util; 007 008 009public enum Fun2 { 010 min, 011 max, 012 atan2, 013 dist, 014 modulo("%"), 015 rshift(">>"), 016 lshift("<<"), 017 xor("^"), 018 bitOr("|"), 019 bitAnd("&"), 020 add("+"), 021 substract("-"), 022 multiply("*"), 023 divide("/"); 024 025 String infixOp; 026 Fun2() {} 027 Fun2(String infixOp) { 028 this.infixOp = infixOp; 029 } 030 void expr(String a, String b, StringBuilder out) { 031 if (infixOp == null) 032 out.append(name()).append('(').append(a).append(", ").append(b).append(")"); 033 else 034 out.append(a).append(' ').append(infixOp).append(' ').append(b); 035 } 036}