Reduces visibility of internal fields/methods

Reduces the visibility of all fields to private and create setters/getters
when necessary. Exceptions are fields with GuiSync as these need to be
public.

Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
yueh
2015-10-08 15:42:42 +02:00
parent f054bd699b
commit e94a0cfccf
497 changed files with 7865 additions and 6908 deletions
@@ -26,18 +26,18 @@ import appeng.util.ItemSorters;
public class EnergyThreshold implements Comparable<EnergyThreshold>
{
public final double Limit;
public final IEnergyWatcher watcher;
final int hash;
private final double Limit;
private final IEnergyWatcher watcher;
private final int hash;
public EnergyThreshold( final double lim, final IEnergyWatcher wat )
{
this.Limit = lim;
this.watcher = wat;
if( this.watcher != null )
if( this.getWatcher() != null )
{
this.hash = this.watcher.hashCode() ^ ( (Double) lim ).hashCode();
this.hash = this.getWatcher().hashCode() ^ ( (Double) lim ).hashCode();
}
else
{
@@ -54,6 +54,16 @@ public class EnergyThreshold implements Comparable<EnergyThreshold>
@Override
public int compareTo( final EnergyThreshold o )
{
return ItemSorters.compareDouble( this.Limit, o.Limit );
return ItemSorters.compareDouble( this.getLimit(), o.getLimit() );
}
double getLimit()
{
return this.Limit;
}
public IEnergyWatcher getWatcher()
{
return this.watcher;
}
}