Package com.gengoai
Interface Copyable<E>
-
- Type Parameters:
E
- The type of object that being copied
- All Known Implementing Classes:
BaseMapCounter
,ConcurrentHashMapCounter
,HashMapCounter
,HashMapIndex
,LocalMAccumulator
,LocalMCounterAccumulator
,LocalMDoubleAccumulator
,LocalMListAccumulator
,LocalMLongAccumulator
,LocalMMapAccumulator
,LocalMMultiCounterAccumulator
,LocalMSetAccumulator
,LocalMStatisticsAccumulator
,NTuple
,ParamMap
,QueryOperator
,QueryStatement
,Select
,Tuple
,Tuple0
,Tuple1
,Tuple2
,Tuple3
,Tuple4
public interface Copyable<E>
The Copyable interface defines a method for returning a copy of an object. Individual implementations are left to determine if the copy is deep or shallow. However, a preference is for deep copies.This interface acts an alternative to Java's clone method providing a generic return type. To aid possible implementations, a static
deepCopy
method is provided that uses Java serialization to perform a deep copy of an object.- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description E
copy()
Makes a copy of this object.static <T> T
deepCopy(T object)
Deep copies an object using serialization.
-
-
-
Method Detail
-
deepCopy
static <T> T deepCopy(T object)
Deep copies an object using serialization.- Type Parameters:
T
- the serializable type parameter- Parameters:
object
- the object to copy- Returns:
- the copied object
-
copy
E copy()
Makes a copy of this object.
- Returns:
- A copy of this object.
-
-