Fix some comments and indent style

This commit is contained in:
Olof Larsson 2013-04-20 15:50:50 +02:00
parent dc15ec2d6c
commit c24a9a63dc
8 changed files with 239 additions and 200 deletions

View File

@ -4,6 +4,17 @@ import java.util.Comparator;
public class PriorityComparator implements Comparator<Prioritized>
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static PriorityComparator i = new PriorityComparator();
public static PriorityComparator get() { return i; }
// -------------------------------------------- //
// OVERRIDE: COMPARATOR
// -------------------------------------------- //
@Override
public int compare(Prioritized one, Prioritized two)
{
@ -14,11 +25,4 @@ public class PriorityComparator implements Comparator<Prioritized>
return Integer.valueOf(one.getPriority()).compareTo(two.getPriority());
}
// -------------------------------------------- //
// INSTANCE
// -------------------------------------------- //
private static PriorityComparator i = new PriorityComparator();
public static PriorityComparator get() { return i; }
}

View File

@ -4,6 +4,17 @@ import java.util.Comparator;
public class ReversePriorityComparator implements Comparator<Prioritized>
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ReversePriorityComparator i = new ReversePriorityComparator();
public static ReversePriorityComparator get() { return i; }
// -------------------------------------------- //
// OVERRIDE: COMPARATOR
// -------------------------------------------- //
@Override
public int compare(Prioritized one, Prioritized two)
{
@ -14,11 +25,4 @@ public class ReversePriorityComparator implements Comparator<Prioritized>
return Integer.valueOf(two.getPriority()).compareTo(one.getPriority());
}
// -------------------------------------------- //
// INSTANCE
// -------------------------------------------- //
private static ReversePriorityComparator i = new ReversePriorityComparator();
public static ReversePriorityComparator get() { return i; }
}

View File

@ -13,6 +13,7 @@ public class SimpleConfig
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
protected transient Plugin plugin;
protected Plugin getPlugin() { return this.plugin; }

View File

@ -34,7 +34,6 @@ public class FireworkEffectAdapter
public static final List<Color> FADE_COLORS_DEFAULT = Collections.unmodifiableList(new ArrayList<Color>());
public static final Type TYPE_DEFAULT = Type.BALL_LARGE;
// -------------------------------------------- //
// TO JSON
// -------------------------------------------- //

View File

@ -47,7 +47,7 @@ public class InventoryAdapter implements JsonDeserializer<Inventory>, JsonSerial
public static InventoryAdapter get() { return i; }
// -------------------------------------------- //
// IMPLEMENTATION
// OVERRIDE
// -------------------------------------------- //
@Override
@ -63,7 +63,7 @@ public class InventoryAdapter implements JsonDeserializer<Inventory>, JsonSerial
}
// -------------------------------------------- //
// JSON
// IMPLEMENTATION
// -------------------------------------------- //
public static JsonElement toJson(Inventory src)

View File

@ -14,7 +14,14 @@ import com.massivecraft.mcore.xlib.mongodb.MongoURI;
public class MongoURIAdapter implements JsonDeserializer<MongoURI>, JsonSerializer<MongoURI>
{
// -------------------------------------------- //
// IMPLEMENTATION
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
protected static MongoURIAdapter i = new MongoURIAdapter();
public static MongoURIAdapter get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
@ -43,10 +50,4 @@ public class MongoURIAdapter implements JsonDeserializer<MongoURI>, JsonSerializ
return new MongoURI(json.getAsString());
}
// -------------------------------------------- //
// INSTANCE
// -------------------------------------------- //
protected static MongoURIAdapter i = new MongoURIAdapter();
public static MongoURIAdapter get() { return i; }
}

View File

@ -77,12 +77,22 @@ public class Money
return mixin.exists(universe(universe), accountId(accountId));
}
public static boolean exists(Object account)
{
return exists(account, account);
}
public static boolean create(Object universe, Object accountId)
{
if (disabled(universe)) return false;
return mixin.create(universe(universe), accountId(accountId));
}
public static boolean create(Object account)
{
return create(account, account);
}
// -------------------------------------------- //
// GET AND SET
// -------------------------------------------- //
@ -93,12 +103,22 @@ public class Money
return mixin.get(universe(universe), accountId(accountId));
}
public static double get(Object account)
{
return get(account, account);
}
public static boolean set(Object universe, Object accountId, double amount)
{
if (disabled(universe)) return false;
return mixin.set(universe(universe), accountId(accountId), amount);
}
public static boolean set(Object account, double amount)
{
return set(account, account, amount);
}
// -------------------------------------------- //
// MODIFY
// -------------------------------------------- //
@ -109,10 +129,20 @@ public class Money
return mixin.add(universe(universe), accountId(accountId), amount);
}
public static boolean add(Object account, double amount)
{
return add(account, account, amount);
}
public static boolean subtract(Object universe, Object accountId, double amount)
{
if (disabled(universe)) return false;
return mixin.subtract(universe(universe), accountId(accountId), amount);
}
public static boolean subtract(Object account, double amount)
{
return subtract(account, account, amount);
}
}