List of usage examples for java.lang CloneNotSupportedException CloneNotSupportedException
public CloneNotSupportedException(String s)
CloneNotSupportedException
with the specified detail message. From source file:com.ibm.bi.dml.hops.Hop.java
/** * Clones the attributes of that and copies it over to this. * /*from ww w . j a va 2s. c o m*/ * @param that * @throws HopsException */ protected void clone(Hop that, boolean withRefs) throws CloneNotSupportedException { if (withRefs) throw new CloneNotSupportedException("Hops deep copy w/ lops/inputs/parents not supported."); _ID = that._ID; _name = that._name; _dataType = that._dataType; _valueType = that._valueType; _visited = that._visited; _dim1 = that._dim1; _dim2 = that._dim2; _rows_in_block = that._rows_in_block; _cols_in_block = that._cols_in_block; _nnz = that._nnz; //no copy of lops (regenerated) _parent = new ArrayList<Hop>(); _input = new ArrayList<Hop>(); _lops = null; _etype = that._etype; _etypeForced = that._etypeForced; _outputMemEstimate = that._outputMemEstimate; _memEstimate = that._memEstimate; _processingMemEstimate = that._processingMemEstimate; _requiresRecompile = that._requiresRecompile; _requiresReblock = that._requiresReblock; _requiresCheckpoint = that._requiresCheckpoint; _outputEmptyBlocks = that._outputEmptyBlocks; _beginLine = that._beginLine; _beginColumn = that._beginColumn; _endLine = that._endLine; _endColumn = that._endColumn; }
From source file:org.apache.sysml.hops.Hop.java
/** * Clones the attributes of that and copies it over to this. * /* w w w . j a va 2 s . c om*/ * @param that high-level operator * @param withRefs true if with references * @throws CloneNotSupportedException if CloneNotSupportedException occurs */ protected void clone(Hop that, boolean withRefs) throws CloneNotSupportedException { if (withRefs) throw new CloneNotSupportedException("Hops deep copy w/ lops/inputs/parents not supported."); _ID = that._ID; _name = that._name; _dataType = that._dataType; _valueType = that._valueType; _visited = that._visited; _dim1 = that._dim1; _dim2 = that._dim2; _rows_in_block = that._rows_in_block; _cols_in_block = that._cols_in_block; _nnz = that._nnz; _updateType = that._updateType; //no copy of lops (regenerated) _parent = new ArrayList<Hop>(); _input = new ArrayList<Hop>(); _lops = null; _etype = that._etype; _etypeForced = that._etypeForced; _outputMemEstimate = that._outputMemEstimate; _memEstimate = that._memEstimate; _processingMemEstimate = that._processingMemEstimate; _requiresRecompile = that._requiresRecompile; _requiresReblock = that._requiresReblock; _requiresCheckpoint = that._requiresCheckpoint; _outputEmptyBlocks = that._outputEmptyBlocks; _beginLine = that._beginLine; _beginColumn = that._beginColumn; _endLine = that._endLine; _endColumn = that._endColumn; }
From source file:net.sf.ehcache.Cache.java
/** * Clones a cache. This is only legal if the cache has not been * initialized. At that point only primitives have been set and no * {@link net.sf.ehcache.store.LruMemoryStore} or {@link net.sf.ehcache.store.DiskStore} has been created. * <p/>//from ww w . j av a2 s .c o m * A new, empty, RegisteredEventListeners is created on clone. * <p/> * * @return an object of type {@link Cache} * @throws CloneNotSupportedException */ public final Object clone() throws CloneNotSupportedException { if (!(memoryStore == null && diskStore == null)) { throw new CloneNotSupportedException("Cannot clone an initialized cache."); } Cache copy = (Cache) super.clone(); copy.configuration = (CacheConfiguration) configuration.clone(); copy.guid = createGuid(); RegisteredEventListeners registeredEventListenersFromCopy = copy.getCacheEventNotificationService(); if (registeredEventListenersFromCopy == null || registeredEventListenersFromCopy.getCacheEventListeners().size() == 0) { copy.registeredEventListeners = new RegisteredEventListeners(copy); } else { copy.registeredEventListeners = new RegisteredEventListeners(copy); Set cacheEventListeners = registeredEventListeners.getCacheEventListeners(); for (Iterator iterator = cacheEventListeners.iterator(); iterator.hasNext();) { CacheEventListener cacheEventListener = (CacheEventListener) iterator.next(); CacheEventListener cacheEventListenerClone = (CacheEventListener) cacheEventListener.clone(); copy.registeredEventListeners.registerListener(cacheEventListenerClone); } } copy.registeredCacheExtensions = createNewCacheExtensionsList(); for (int i = 0; i < registeredCacheExtensions.size(); i++) { CacheExtension cacheExtension = (CacheExtension) registeredCacheExtensions.get(i); copy.registerCacheExtension(cacheExtension.clone(copy)); } if (bootstrapCacheLoader != null) { BootstrapCacheLoader bootstrapCacheLoaderClone = (BootstrapCacheLoader) bootstrapCacheLoader.clone(); copy.setBootstrapCacheLoader(bootstrapCacheLoaderClone); } return copy; }