Mercurial Hosting > luan
diff src/luan/LuanCloner.java @ 785:d69d3c51c44e
more work on incremental cloning
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 01 Sep 2016 21:32:28 -0600 |
parents | 6a7c6879158d |
children | e0cf0d108a77 |
line wrap: on
line diff
--- a/src/luan/LuanCloner.java Tue Aug 30 12:08:49 2016 -0600 +++ b/src/luan/LuanCloner.java Thu Sep 01 21:32:28 2016 -0600 @@ -6,11 +6,13 @@ public final class LuanCloner { - public final boolean deep; + public enum Type { COMPLETE, INCREMENTAL } + + public final Type type; private final Map cloned = new IdentityHashMap(); - public LuanCloner(boolean deep) { - this.deep = deep; + public LuanCloner(Type type) { + this.type = type; } public LuanCloneable clone(LuanCloneable obj) { @@ -62,14 +64,4 @@ return clone((Map)obj); return obj; } -/* - public Object check(Object obj) { - if( deep ) - throw new RuntimeException(); - if( !(obj instanceof LuanCloneable) ) - return obj; - LuanCloneable lc = (LuanCloneable)obj; - return lc.getCloner() == this ? lc : clone(lc); - } -*/ }