From a24463842d6578d63a6e2750e90558bf3dc87b4a Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Tue, 1 Dec 2015 11:23:56 +0100 Subject: [PATCH] Simplify Database Constructors. Use Setters. --- src/com/massivecraft/massivecore/store/Coll.java | 13 +++---------- .../massivecraft/massivecore/store/SenderColl.java | 9 +++------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/com/massivecraft/massivecore/store/Coll.java b/src/com/massivecraft/massivecore/store/Coll.java index 10e0972f..f0e02a7d 100644 --- a/src/com/massivecraft/massivecore/store/Coll.java +++ b/src/com/massivecraft/massivecore/store/Coll.java @@ -979,7 +979,7 @@ public class Coll> extends CollAbstract // CONSTRUCT // -------------------------------------------- // - public Coll(String name, Class entityClass, Db db, Plugin plugin, boolean creative, boolean lowercasing, boolean sorted) + public Coll(String name, Class entityClass, Db db, Plugin plugin) { // Setup the name and the parsed parts this.name = name; @@ -995,9 +995,7 @@ public class Coll> extends CollAbstract } // WHAT DO WE HANDLE? - this.entityClass = entityClass; - this.creative = creative; - this.lowercasing = lowercasing; + this.entityClass = entityClass; // SUPPORTING SYSTEM this.plugin = plugin; @@ -1005,7 +1003,7 @@ public class Coll> extends CollAbstract this.collDriverObject = db.createCollDriverObject(this); // STORAGE - this.id2entity = (sorted) ? new ConcurrentSkipListMap(NaturalOrderComparator.get()) : new ConcurrentHashMap(); + this.id2entity = new ConcurrentHashMap(); // ENTITY DATA this.identifiedModifications = new ConcurrentHashMap(); @@ -1016,11 +1014,6 @@ public class Coll> extends CollAbstract }; } - public Coll(String name, Class entityClass, Db db, Plugin plugin) - { - this(name, entityClass, db, plugin, false, false, false); - } - @Override public void init() { diff --git a/src/com/massivecraft/massivecore/store/SenderColl.java b/src/com/massivecraft/massivecore/store/SenderColl.java index 452a8f10..32beecd5 100644 --- a/src/com/massivecraft/massivecore/store/SenderColl.java +++ b/src/com/massivecraft/massivecore/store/SenderColl.java @@ -21,14 +21,11 @@ public class SenderColl> extends Coll implements Se // CONSTRUCT // -------------------------------------------- // - public SenderColl(String name, Class entityClass, Db db, Plugin plugin, boolean creative, boolean lowercasing, boolean sorted) - { - super(name, entityClass, db, plugin, creative, lowercasing, sorted); - } - public SenderColl(String name, Class entityClass, Db db, Plugin plugin) { - super(name, entityClass, db, plugin, true, true, false); + super(name, entityClass, db, plugin); + this.setCreative(true); + this.setLowercasing(true); } // -------------------------------------------- //