1 8 package org.codehaus.aspectwerkz.expression; 9 10 19 public abstract class Undeterministic { 20 21 28 public static Boolean and(Boolean lhs, Boolean rhs) { 29 if (lhs != null && rhs != null) { 30 if (lhs.equals(Boolean.TRUE) && rhs.equals(Boolean.TRUE)) { 32 return Boolean.TRUE; 33 } else { 34 return Boolean.FALSE; 35 } 36 } else if (lhs != null && lhs.equals(Boolean.FALSE)) { 37 return Boolean.FALSE; 39 } else if (rhs != null && rhs.equals(Boolean.FALSE)) { 40 return Boolean.FALSE; 42 } else { 43 return null; 45 } 46 } 47 48 55 public static Boolean or(Boolean lhs, Boolean rhs) { 56 if (lhs != null && rhs != null) { 57 if (lhs.equals(Boolean.TRUE) || rhs.equals(Boolean.TRUE)) { 59 return Boolean.TRUE; 60 } else { 61 return Boolean.FALSE; 62 } 63 } else { 64 return null; 67 } 68 } 69 70 76 public static Boolean not(Boolean b) { 77 if (b != null) { 78 if (b.equals(Boolean.TRUE)) { 80 return Boolean.FALSE; 81 } else { 82 return Boolean.TRUE; 83 } 84 } else { 85 return null; 86 } 87 } 88 89 90 } 91 | Popular Tags |