1 4 package com.tc.aspectwerkz.expression; 5 6 15 public abstract class Undeterministic { 16 17 24 public static Boolean and(Boolean lhs, Boolean rhs) { 25 if (lhs != null && rhs != null) { 26 if (lhs.equals(Boolean.TRUE) && rhs.equals(Boolean.TRUE)) { 28 return Boolean.TRUE; 29 } else { 30 return Boolean.FALSE; 31 } 32 } else if (lhs != null && lhs.equals(Boolean.FALSE)) { 33 return Boolean.FALSE; 35 } else if (rhs != null && rhs.equals(Boolean.FALSE)) { 36 return Boolean.FALSE; 38 } else { 39 return null; 41 } 42 } 43 44 51 public static Boolean or(Boolean lhs, Boolean rhs) { 52 if (lhs != null && rhs != null) { 53 if (lhs.equals(Boolean.TRUE) || rhs.equals(Boolean.TRUE)) { 55 return Boolean.TRUE; 56 } else { 57 return Boolean.FALSE; 58 } 59 } else { 60 return null; 63 } 64 } 65 66 72 public static Boolean not(Boolean b) { 73 if (b != null) { 74 if (b.equals(Boolean.TRUE)) { 76 return Boolean.FALSE; 77 } else { 78 return Boolean.TRUE; 79 } 80 } else { 81 return null; 82 } 83 } 84 85 86 } 87 | Popular Tags |