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
+7 -15
View File
@@ -36,11 +36,10 @@ import appeng.core.worlddata.WorldData;
public class GridStorage implements IGridStorage
{
final long myID;
final NBTTagCompound data;
final GridStorageSearch mySearchEntry; // keep myself in the list until I'm
private final long myID;
private final NBTTagCompound data;
private final GridStorageSearch mySearchEntry; // keep myself in the list until I'm
private final WeakHashMap<GridStorage, Boolean> divided = new WeakHashMap<GridStorage, Boolean>();
public boolean isDirty = false;
private WeakReference<IGrid> internalGrid = null;
// lost...
@@ -95,8 +94,6 @@ public class GridStorage implements IGridStorage
public String getValue()
{
this.isDirty = false;
final Grid currentGrid = (Grid) this.getGrid();
if( currentGrid != null )
{
@@ -122,7 +119,7 @@ public class GridStorage implements IGridStorage
return this.internalGrid == null ? null : this.internalGrid.get();
}
public void setGrid( final Grid grid )
void setGrid( final Grid grid )
{
this.internalGrid = new WeakReference<IGrid>( grid );
}
@@ -139,22 +136,17 @@ public class GridStorage implements IGridStorage
return this.myID;
}
public void markDirty()
{
this.isDirty = true;
}
public void addDivided( final GridStorage gs )
void addDivided( final GridStorage gs )
{
this.divided.put( gs, true );
}
public boolean hasDivided( final GridStorage myStorage )
boolean hasDivided( final GridStorage myStorage )
{
return this.divided.containsKey( myStorage );
}
public void remove()
void remove()
{
WorldData.instance().storageData().destroyGridStorage( this.myID );
}