/** * @param hslaCssValue the hslaCssValue to set * @since 1.0.0 * @author WFF */ public void setHslaCssValue(final HslaCssValue hslaCssValue) { if (hslaCssValue == null) { throw new NullValueException("hslaCssValue can not be null"); } if (this.hslaCssValue != null) { if (hslaCssValue.isAlreadyInUse() && this.hslaCssValue.getStateChangeInformer() != hslaCssValue.getStateChangeInformer()) { try { final HslaCssValue hslaCssValueClone = CloneUtil.deepClone(hslaCssValue); this.hslaCssValue.setAlreadyInUse(false); this.hslaCssValue = hslaCssValueClone; if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning( "cloned hslaCssValue " + hslaCssValue + "(hashcode: " + hslaCssValue.hashCode() + ") as it is already used by another object"); } } catch (final CloneNotSupportedException e) { throw new InvalidValueException(e.toString()); } } else { this.hslaCssValue.setAlreadyInUse(false); this.hslaCssValue = hslaCssValue; } } else { if (hslaCssValue.isAlreadyInUse()) { try { this.hslaCssValue = CloneUtil.deepClone(hslaCssValue); if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning( "cloned hslaCssValue " + hslaCssValue + "(hashcode: " + hslaCssValue.hashCode() + ") as it is already used by another object"); } } catch (final CloneNotSupportedException e) { throw new InvalidValueException(e.toString()); } } else { this.hslaCssValue = hslaCssValue; } } cssValue = this.hslaCssValue.getValue(); this.hslaCssValue.setStateChangeInformer(this); this.hslaCssValue.setAlreadyInUse(true); makeRgbCssValueNull(); makeRgbaCssValueNull(); makeHslCssValueNull(); }
@Override public LargeMailUser clone() { LargeMailUser copy; try { copy = ((LargeMailUser) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.addressLine = new ArrayList<AddressLine>((getAddressLine().size())); for (AddressLine iter : addressLine) { copy.addressLine.add(iter.clone()); } copy.largeMailUserName = new ArrayList<LargeMailUser.LargeMailUserName>((getLargeMailUserName().size())); for (LargeMailUser.LargeMailUserName iter : largeMailUserName) { copy.largeMailUserName.add(iter.clone()); } copy.largeMailUserIdentifier = ((largeMailUserIdentifier == null) ? null : ((LargeMailUser.LargeMailUserIdentifier) largeMailUserIdentifier.clone())); copy.buildingName = new ArrayList<BuildingName>((getBuildingName().size())); for (BuildingName iter : buildingName) { copy.buildingName.add(iter.clone()); } copy.department = ((department == null) ? null : ((Department) department.clone())); copy.postBox = ((postBox == null) ? null : ((PostBox) postBox.clone())); copy.thoroughfare = ((thoroughfare == null) ? null : ((Thoroughfare) thoroughfare.clone())); copy.postalCode = ((postalCode == null) ? null : ((PostalCode) postalCode.clone())); copy.any = new ArrayList<Object>((getAny().size())); for (Object iter : any) { copy.any.add(iter); } return copy; }
/** * clone a copy of oclOperator * * @throws CloneNotSupportedException * @return Object */ public Object clone() throws CloneNotSupportedException { try { oclEvent op = new oclEvent(); op.opName = (oclPredicate) opName.clone(); ListIterator li = prevail.listIterator(); while (li.hasNext()) { oclSE se = (oclSE) li.next(); op.addPrevSE((oclSE) se.clone()); } li = necessary.listIterator(); while (li.hasNext()) { oclSC sc = (oclSC) li.next(); op.addNecSC((oclSC) sc.clone()); } li = conditional.listIterator(); while (li.hasNext()) { oclSC sc = (oclSC) li.next(); op.addCondSC((oclSC) sc.clone()); } return op; } catch (CloneNotSupportedException e) { Utility.debugPrintln("Failed to clone event component + " + e.toString()); throw e; } }
/** * Clones a <code>List</code> of <code>TransactionEntry(s)</code> * * @param fees <code>List</code> of fees to clone */ public void setTransactionEntries(final List<TransactionEntry> fees) { feeList = new ArrayList<>(); if (fees.size() == 1) { TransactionEntry e = fees.get(0); if (e.getCreditAccount().equals(e.getDebitAccount())) { feeField.setDecimal(e.getAmount(account).abs()); } else { try { feeList.add((TransactionEntry) e.clone()); // copy over the provided set's entry } catch (CloneNotSupportedException e1) { Logger.getLogger(FeePanel.class.getName()) .log(Level.SEVERE, e1.getLocalizedMessage(), e1); } feeField.setDecimal(sumFees().abs()); } } else { for (TransactionEntry entry : fees) { // clone the provided set's entries try { feeList.add((TransactionEntry) entry.clone()); } catch (CloneNotSupportedException e) { Logger.getLogger(FeePanel.class.getName()).log(Level.SEVERE, e.toString(), e); } } feeField.setDecimal(sumFees().abs()); } feeField.setEditable(feeList.size() < 1); }
public Vehicle clone() throws CloneNotSupportedException { try { return (Vehicle) super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
public Object clone() { try { SafeFileMonitor_1 ret = (SafeFileMonitor_1) super.clone(); return ret; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
@Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
/** * Returns a copy of this object. Changes to the copy will not affect the original and vice versa. * * <p>Note: this method currently performs a shallow copy of the object (simply calls <code> * Object.clone()</code>). This may be changed in a future revision to perform a deep copy if new * parameters are added that should not be shared. * * @return the copy */ public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { /* Cannot happen */ throw new InternalError(e.toString()); } }
public Layer clone() { try { Layer result = (Layer) super.clone(); return result; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
/** Return a shallow copy of this ref. */ public Object clone() { try { LiveRef newRef = (LiveRef) super.clone(); return newRef; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
@Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnse) { // Shouldn't happen since we do implement Clonable throw new InternalError(cnse.toString()); } }
@Override public FloatData clone() throws CloneNotSupportedException { try { FloatData data = (FloatData) super.clone(); return data; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
@Override public Object clone() { ClassForTest clone = null; try { clone = (ClassForTest) super.clone(); } catch (CloneNotSupportedException ex) { System.out.println("Exception: " + ex.toString()); } return clone; }
/** Clone this weighting model */ @Override public BasicModel clone() { try { BasicModel newModel = (BasicModel) super.clone(); newModel.i = (Idf) this.i.clone(); return newModel; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
/* (non-Javadoc) * This method is required to separate between ServiceTemplates that * 1.are stored as part of an experiment an may not be deleted and templates * 2.that are registered by the admin. So if 2. gets deleted 1. must be still available * @see java.lang.Object#clone() */ public TestbedServiceTemplateImpl clone() { TestbedServiceTemplateImpl template = new TestbedServiceTemplateImpl(); try { template = (TestbedServiceTemplateImpl) super.clone(); } catch (CloneNotSupportedException e) { log.error("Error cloning TestbedServiceTemplateImpl Object" + e.toString()); } return template; }
/** * Creates a new Vector with the same contents as this one. The clone is shallow; elements are not * cloned. * * @return the clone of this vector */ public synchronized Object clone() { try { Vector clone = (Vector) super.clone(); clone.elementData = (Object[]) elementData.clone(); return clone; } catch (CloneNotSupportedException ex) { // Impossible to get here. throw new InternalError(ex.toString()); } }
@Override public LargeMailUser.LargeMailUserName clone() { LargeMailUser.LargeMailUserName copy; try { copy = ((LargeMailUser.LargeMailUserName) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } return copy; }
public NetErrorBean clone() { NetErrorBean o = null; try { o = (NetErrorBean) super.clone(); // Object 中的clone()识别出你要复制的是哪一个对象。 o.errorCode = this.errorCode; o.errorMessage = this.errorMessage; } catch (CloneNotSupportedException e) { System.out.println(e.toString()); } return o; }
/** * Clones a neuron/rbf * * @return a copy of a neuron */ public Object clone() { try { Rbf rbf = (Rbf) super.clone(); rbf.centre = (double[]) centre.clone(); rbf.weight = (double[]) weight.clone(); rbf.vectors = vectors; return (rbf); } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
public DTMAxisIterator cloneIterator() { try { final DupFilterIterator clone = (DupFilterIterator) super.clone(); clone._nodes = (IntegerArray) _nodes.clone(); clone._source = _source.cloneIterator(); clone._isRestartable = false; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
/** * Clone the current branch state. Used by the mouse recording process. * * @return Object * @throws InternalError DOCUMENT ME! */ @Override protected Object clone() { // Should not get clone unsupported exception since we use // the Object mehtod's clone which just replicated data // values and references. try { return super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
/** Confirm that cloning works. */ public void testCloning() { CompositeTitle t1 = new CompositeTitle(new BlockContainer()); t1.getContainer().add(new TextTitle("T1")); t1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); CompositeTitle t2 = null; try { t2 = (CompositeTitle) t1.clone(); } catch (CloneNotSupportedException e) { fail(e.toString()); } assertTrue(t1 != t2); assertTrue(t1.getClass() == t2.getClass()); assertTrue(t1.equals(t2)); }
/** * clone * * @return an AbstractObject clone */ protected Object clone() { try { AbstractObjectUsage bou = (AbstractObjectUsage) super.clone(); JdoDelegateAction.getInstance().clone(bou); // bou.object keep the same value because it is the same object bou.object = object; bou.validated = false; return bou; } catch (CloneNotSupportedException e) { throw new InternalError(e.toString()); } }
/** * Creates a deep copy of this {@link HeapNode}. The clone is not reset from the current * position of the original. * * @return the cloned heap node */ public HeapNode cloneHeapNode() { HeapNode clone; try { clone = (HeapNode) super.clone(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } clone._node = _node; clone._markedNode = _node; return clone; }
public Index clone() { try { Index clone = (Index) super.clone(); clone.table = this.table.clone(); Entry list[], table[][] = clone.table; for (int cc = 0, len = this.size; cc < len; cc++) { list = table[cc]; if (null != list) table[cc] = list.clone(); } return clone; } catch (CloneNotSupportedException exc) { throw new InternalError(exc.toString()); } }
public DTMAxisIterator cloneIterator() { _isRestartable = false; final HeapNode[] heapCopy = new HeapNode[_heap.length]; try { MultiValuedNodeHeapIterator clone = (MultiValuedNodeHeapIterator) super.clone(); for (int i = 0; i < _free; i++) { heapCopy[i] = _heap[i].cloneHeapNode(); } clone.setRestartable(false); clone._heap = heapCopy; return clone.reset(); } catch (CloneNotSupportedException e) { BasisLibrary.runTimeError(BasisLibrary.ITERATOR_CLONE_ERR, e.toString()); return null; } }
/** * Overridden to make clone public. Returns a shallow copy of this node; the new node has no * parent or children and has a reference to the same user object, if any. * * @return a copy of this node */ public Object clone() { DefaultMutableTreeNode newNode; try { newNode = (DefaultMutableTreeNode) super.clone(); // shallow copy -- the new node has no parent or children newNode.children = null; newNode.parent = null; } catch (CloneNotSupportedException e) { // Won't happen because we implement Cloneable throw new Error(e.toString()); } return newNode; }
@Override public void run() { try { SecurityNode clone = (SecurityNode) sNode.clone(); Engine engine = EngineFactory.getEngine(EngineFactory.DEFAULT); CurrencyNode currencyNode = engine.getCurrency(cNode); if (currencyNode != null) { clone.setReportedCurrencyNode(currencyNode); engine.updateCommodity(sNode, clone); } } catch (CloneNotSupportedException e) { logger.log(Level.SEVERE, e.toString(), e); } }
@Override public Schema clone() { Schema copy; try { copy = ((Schema) super.clone()); } catch (CloneNotSupportedException _x) { throw new InternalError((_x.toString())); } copy.simpleField = new ArrayList<SimpleField>((getSimpleField().size())); for (SimpleField iter : simpleField) { copy.simpleField.add(iter.clone()); } copy.schemaExtension = new ArrayList<Object>((getSchemaExtension().size())); for (Object iter : schemaExtension) { copy.schemaExtension.add(iter); } return copy; }
/** * Returns a copy that can be associated with another EgDemand. The copy has the same amounts, * reason, time stamp and (cloned) receipts if any. (Note: making it public instead of protected * to allow any class to use it.) */ @Override public Object clone() { EgDemandDetails clone = null; try { clone = (EgDemandDetails) super.clone(); } catch (CloneNotSupportedException e) { // this should never happen throw new InternalError(e.toString()); } clone.setId(null); clone.setEgwStatus(null); clone.setEgdmCollectedReceipts(new HashSet<EgdmCollectedReceipt>()); for (EgdmCollectedReceipt receipt : getEgdmCollectedReceipts()) { EgdmCollectedReceipt cloneRec = (EgdmCollectedReceipt) receipt.clone(); cloneRec.setEgdemandDetail(this); clone.addEgdmCollectedReceipt(cloneRec); } return clone; }