/** * Finds the CacheExpression that has been associated with an expression. If * it is the first time the Expression is being added to the Cache, a new * CacheExpression is created and associated with the expression. <p/> This * method updates the reference counters on the CacheExpression to know when * it is no longer needed. */ private CacheExpression addToCache(Expression expr) { CacheExpression n = cachedExpressions.get(expr); if (n == null) { n = new CacheExpression(expr); cachedExpressions.put(expr, n); if (expr instanceof UnaryExpression) { // Cache the sub expressions too UnaryExpression un = (UnaryExpression)expr; un.setRight(addToCache(un.getRight())); } else if (expr instanceof BinaryExpression) { // Cache the sub expressions too. BinaryExpression bn = (BinaryExpression)expr; bn.setRight(addToCache(bn.getRight())); bn.setLeft(addToCache(bn.getLeft())); } } n.refCount++; return n; }
/** * Finds the CacheExpression that has been associated with an expression. If * it is the first time the Expression is being added to the Cache, a new * CacheExpression is created and associated with the expression. <p/> This * method updates the reference counters on the CacheExpression to know when * it is no longer needed. */ private CacheExpression addToCache(Expression expr) { CacheExpression n = cachedExpressions.get(expr); if (n == null) { n = new CacheExpression(expr); cachedExpressions.put(expr, n); if (expr instanceof UnaryExpression) { // Cache the sub expressions too UnaryExpression un = (UnaryExpression)expr; un.setRight(addToCache(un.getRight())); } else if (expr instanceof BinaryExpression) { // Cache the sub expressions too. BinaryExpression bn = (BinaryExpression)expr; bn.setRight(addToCache(bn.getRight())); bn.setLeft(addToCache(bn.getLeft())); } } n.refCount++; return n; }
/** * Finds the CacheExpression that has been associated with an expression. If * it is the first time the Expression is being added to the Cache, a new * CacheExpression is created and associated with the expression. <p/> This * method updates the reference counters on the CacheExpression to know when * it is no longer needed. */ private CacheExpression addToCache(Expression expr) { CacheExpression n = cachedExpressions.get(expr); if (n == null) { n = new CacheExpression(expr); cachedExpressions.put(expr, n); if (expr instanceof UnaryExpression) { // Cache the sub expressions too UnaryExpression un = (UnaryExpression)expr; un.setRight(addToCache(un.getRight())); } else if (expr instanceof BinaryExpression) { // Cache the sub expressions too. BinaryExpression bn = (BinaryExpression)expr; bn.setRight(addToCache(bn.getRight())); bn.setLeft(addToCache(bn.getLeft())); } } n.refCount++; return n; }
/** * Finds the CacheExpression that has been associated with an expression. If * it is the first time the Expression is being added to the Cache, a new * CacheExpression is created and associated with the expression. <p/> This * method updates the reference counters on the CacheExpression to know when * it is no longer needed. */ private CacheExpression addToCache(Expression expr) { CacheExpression n = cachedExpressions.get(expr); if (n == null) { n = new CacheExpression(expr); cachedExpressions.put(expr, n); if (expr instanceof UnaryExpression) { // Cache the sub expressions too UnaryExpression un = (UnaryExpression)expr; un.setRight(addToCache(un.getRight())); } else if (expr instanceof BinaryExpression) { // Cache the sub expressions too. BinaryExpression bn = (BinaryExpression)expr; bn.setRight(addToCache(bn.getRight())); bn.setLeft(addToCache(bn.getLeft())); } } n.refCount++; return n; }
/** * Finds the CacheExpression that has been associated with an expression. If * it is the first time the Expression is being added to the Cache, a new * CacheExpression is created and associated with the expression. <p/> This * method updates the reference counters on the CacheExpression to know when * it is no longer needed. */ private CacheExpression addToCache(Expression expr) { CacheExpression n = cachedExpressions.get(expr); if (n == null) { n = new CacheExpression(expr); cachedExpressions.put(expr, n); if (expr instanceof UnaryExpression) { // Cache the sub expressions too UnaryExpression un = (UnaryExpression)expr; un.setRight(addToCache(un.getRight())); } else if (expr instanceof BinaryExpression) { // Cache the sub expressions too. BinaryExpression bn = (BinaryExpression)expr; bn.setRight(addToCache(bn.getRight())); bn.setLeft(addToCache(bn.getLeft())); } } n.refCount++; return n; }