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
@@ -35,9 +35,9 @@ import appeng.me.cache.GridStorageCache;
public class ItemWatcher implements IStackWatcher
{
final GridStorageCache gsc;
final IStackWatcherHost myObject;
final HashSet<IAEStack> myInterests = new HashSet<IAEStack>();
private final GridStorageCache gsc;
private final IStackWatcherHost myObject;
private final HashSet<IAEStack> myInterests = new HashSet<IAEStack>();
public ItemWatcher( final GridStorageCache cache, final IStackWatcherHost host )
{
@@ -94,13 +94,13 @@ public class ItemWatcher implements IStackWatcher
return false;
}
return this.myInterests.add( e.copy() ) && this.gsc.interestManager.put( e, this );
return this.myInterests.add( e.copy() ) && this.gsc.getInterestManager().put( e, this );
}
@Override
public boolean remove( final Object o )
{
return this.myInterests.remove( o ) && this.gsc.interestManager.remove( (IAEStack) o, this );
return this.myInterests.remove( o ) && this.gsc.getInterestManager().remove( (IAEStack) o, this );
}
@Override
@@ -157,17 +157,17 @@ public class ItemWatcher implements IStackWatcher
final Iterator<IAEStack> i = this.myInterests.iterator();
while( i.hasNext() )
{
this.gsc.interestManager.remove( i.next(), this );
this.gsc.getInterestManager().remove( i.next(), this );
i.remove();
}
}
class ItemWatcherIterator implements Iterator<IAEStack>
private class ItemWatcherIterator implements Iterator<IAEStack>
{
final ItemWatcher watcher;
final Iterator<IAEStack> interestIterator;
IAEStack myLast;
private final ItemWatcher watcher;
private final Iterator<IAEStack> interestIterator;
private IAEStack myLast;
public ItemWatcherIterator( final ItemWatcher parent, final Iterator<IAEStack> i )
{
@@ -190,7 +190,7 @@ public class ItemWatcher implements IStackWatcher
@Override
public void remove()
{
ItemWatcher.this.gsc.interestManager.remove( this.myLast, this.watcher );
ItemWatcher.this.gsc.getInterestManager().remove( this.myLast, this.watcher );
this.interestIterator.remove();
}
}