public Stage createClone() { return CLONER.deepClone(this); }
} else { JoH.benchmark(null); Cloner cloner = new Cloner(); cloner.dontClone( lecho.lib.hellocharts.model.PointValue.class, lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter.class, lecho.lib.hellocharts.model.Axis.class, android.graphics.DashPathEffect.class); previewLineData = cloner.deepClone(hint); JoH.benchmark("Clone preview data"); if (d) Log.d(TAG,"Cloned preview chart data");
public Alignment getAlignmentClone() { Cloner cloner = new Cloner(); // cloner.setDumpClonedClasses(true); cloner.dontClone(OntologyManager.class); cloner.dontCloneInstanceOf(OntologyManager.class); cloner.dontClone(DirectedWeightedMultigraph.class); cloner.dontCloneInstanceOf(DirectedWeightedMultigraph.class); return cloner.deepClone(this); }
/** * @return a standard cloner instance, will do for most use cases */ public static Cloner standard() { return new Cloner(); }
public static Cloner newCloner() { Cloner cloner = new Cloner(); //Implement custom cloning for INDArrays (default can have problems with off-heap and pointers) //Sadly: the cloner library does NOT support interfaces here, hence we need to use the actual classes //cloner.registerFastCloner(INDArray.class, new INDArrayFastCloner()); //Does not work due to interface IFastCloner fc = new INDArrayFastCloner(); cloner.registerFastCloner(Nd4j.getBackend().getNDArrayClass(), fc); cloner.registerFastCloner(Nd4j.getBackend().getComplexNDArrayClass(), fc); //Same thing with DataBuffers: off heap -> cloner library chokes on them, but need to know the concrete // buffer classes, not just the interface IFastCloner fc2 = new DataBufferFastCloner(); DataBufferFactory d = Nd4j.getDataBufferFactory(); doReg(cloner, fc2, d.intBufferClass()); doReg(cloner, fc2, d.longBufferClass()); doReg(cloner, fc2, d.halfBufferClass()); doReg(cloner, fc2, d.floatBufferClass()); doReg(cloner, fc2, d.doubleBufferClass()); doReg(cloner, fc2, CompressedDataBuffer.class); return cloner; }
private static Performable instrumentedCopyOf(Performable task, Class taskClass) { Performable instrumentedTask = null; try { instrumentedTask = (Performable) Instrumented.instanceOf(taskClass).newInstance(); } catch(IllegalArgumentException missingDefaultConstructor) { throw new TaskInstantiationException("Could not instantiate " + taskClass + ". If you are not instrumenting a Task class explicitly you need to give the class a default constructor." + "A task class cannot be instrumented if it is final (so if you are writing in Kotlin, make sure the task class is 'open'."); } Cloner cloner = new Cloner(); cloner.copyPropertiesOfInheritedClass(task, instrumentedTask); return instrumentedTask; }
public CheckListPropertyHelper ignoreClone(Class<?> ignoringClass) { cloner.dontClone(ignoringClass); return this; }
/** * Return a completely independent shallow copy instance of the incoming object. The * returned object CANNOT be freely mutated without any consequential changes * being made to the originating object. * * Use with care - the returned object may share references with the original object. * * @param object to be replicated * @return shallow replicated object */ public T shallowReplicate(T object) { return cloner.shallowClone(object); } }
public void usingTemplate(PipelineTemplateConfig pipelineTemplate) { this.addAll(CLONER.deepClone(pipelineTemplate)); this.templateApplied = true; }
} else { JoH.benchmark(null); Cloner cloner = new Cloner(); cloner.dontClone( lecho.lib.hellocharts.model.PointValue.class, lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter.class, lecho.lib.hellocharts.model.Axis.class, android.graphics.DashPathEffect.class); previewLineData = cloner.deepClone(hint); JoH.benchmark("Clone preview data"); if (d) Log.d(TAG,"Cloned preview chart data");
/** * @return a standard cloner instance, will do for most use cases */ public static Cloner standard() { return new Cloner(); }
@Override public void dontClone(Class<?>... c) { for (Class<?> cl : c) { this.ignored.add(cl); } super.dontClone(c); }
UserError.Log.d(TAG, "Error writing characteristic: " + localmCharacteristic.getUuid() + " " + JoH.bytesToHex(value)); final BluetoothGattCharacteristic resendCharacteristic = cloner.shallowClone(localmCharacteristic);
public ParamResolver applyOver(ParamResolver enclosingScope) { return enclosingScope.override(CLONER.deepClone(params)); }
@Inject public AllScenariosPageRenderer(final ChartJsonConverter chartJsonConverter, PropertyManager propertyManager) { super(chartJsonConverter); this.propertyManager = propertyManager; cloner = new Cloner(); }
@Override public void dontClone(Class<?>... c) { for (Class<?> cl : c) { this.ignored.add(cl); } super.dontClone(c); }
UserError.Log.d(TAG, "Error writing characteristic: " + localmCharacteristic.getUuid() + " " + JoH.bytesToHex(value)); final BluetoothGattCharacteristic resendCharacteristic = cloner.shallowClone(localmCharacteristic);