/** * Do clone makes a deep clone without regarding cycles. * Method is overridden by subclasses to actually incorporate their attributes. * @param theclone The clone. */ protected void doClone(Object theclone) { AlphaNode clone = (AlphaNode)theclone; // Deep clone tuple consumers clone.oconsumers = new IObjectConsumerNode[oconsumers.length]; for(int i=0; i<oconsumers.length; i++) clone.oconsumers[i] = (IObjectConsumerNode)oconsumers[i].clone(); // Set the new source clone.setObjectSource((IObjectSourceNode)osource.clone()); // Shallow clone evaluators if(evaluators!=null) { clone.evaluators = new IConstraintEvaluator[evaluators.length]; System.arraycopy(evaluators, 0, clone.evaluators, 0, evaluators.length); } // Shallow copy the relevant attributes if(relevants!=null) clone.relevants = (AttributeSet)((AttributeSet)relevants).clone(); } }
/** * Do clone makes a deep clone without regarding cycles. * Method is overridden by subclasses to actually incorporate their attributes. * @param theclone The clone. */ protected void doClone(Object theclone) { AlphaNode clone = (AlphaNode)theclone; // Deep clone tuple consumers clone.oconsumers = new IObjectConsumerNode[oconsumers.length]; for(int i=0; i<oconsumers.length; i++) clone.oconsumers[i] = (IObjectConsumerNode)oconsumers[i].clone(); // Set the new source clone.setObjectSource((IObjectSourceNode)osource.clone()); // Shallow clone evaluators if(evaluators!=null) { clone.evaluators = new IConstraintEvaluator[evaluators.length]; System.arraycopy(evaluators, 0, clone.evaluators, 0, evaluators.length); } // Shallow copy the relevant attributes if(relevants!=null) clone.relevants = (AttributeSet)((AttributeSet)relevants).clone(); } }