QJCC homepage

biz.chitec.quarterback.util.logic
Class LogicExprUtilities

java.lang.Object
  extended bybiz.chitec.quarterback.util.logic.LogicExprUtilities

public final class LogicExprUtilities
extends java.lang.Object

Helper methods for logic expressions.

Version:
$Id: b9c3d413228789326a6c7ee784f2132f0314fd90 $
Author:
chitec/Dirk Hillbrecht 2001, cantamen/Dirk Hillbrecht 2004,2005. Distributed under the terms of the GNU LGPL.

Constructor Summary
private LogicExprUtilities()
           
 
Method Summary
static LogicExpr cloneLogicExpr(LogicExpr le)
          Deep-copies the given logic expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogicExprUtilities

private LogicExprUtilities()
Method Detail

cloneLogicExpr

public static final LogicExpr cloneLogicExpr(LogicExpr le)
Deep-copies the given logic expression. This method calls clone() on the given logic expression. The result is a deep copy of the complete expression tree.

As LogicExpr-derivates must implement the clone() method due to their interface definition, a CloneNotSupportedException should not arise. Theoretically, a LogicExpr descendant could implement clone() with simply throwing CloneNotSupportedException, so there is actually a chance that the exception is thrown. If it is catched, it is wrapped into a RuntimeException and rethrown. Advantage: It must not be declared explicitly in the caller. Rationale: It should simply not happen as the LogicExpr contract says that each implementation must have a working clone() method.

Parameters:
le - LogicExpr to clone or null
Returns:
Deep copy of the given expr, null if given expression was null.

QJCC homepage