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
@@ -132,7 +132,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
enabled &= IntegrationRegistry.INSTANCE.isEnabled( integrationType );
}
final int partDamage = mat.baseDamage + varID;
final int partDamage = mat.getBaseDamage() + varID;
final ActivityState state = ActivityState.from( enabled );
final ItemStackSrc output = new ItemStackSrc( this, partDamage, state );
@@ -254,7 +254,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
}
}
public String getName( final ItemStack is )
private String getName( final ItemStack is )
{
Preconditions.checkNotNull( is );
@@ -291,12 +291,12 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
try
{
if( type.constructor == null )
if( type.getConstructor() == null )
{
type.constructor = part.getConstructor( ItemStack.class );
type.setConstructor( part.getConstructor( ItemStack.class ) );
}
return type.constructor.newInstance( is );
return type.getConstructor().newInstance( is );
}
catch( final InstantiationException e )
{
+21 -6
View File
@@ -160,12 +160,12 @@ public enum PartType
InterfaceTerminal( 480, EnumSet.of( AEFeature.InterfaceTerminal ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class );
public final int baseDamage;
private final int baseDamage;
private final Set<AEFeature> features;
private final Set<IntegrationType> integrations;
private final Class<? extends IPart> myPart;
private final GuiText extraName;
public Constructor<? extends IPart> constructor;
private Constructor<? extends IPart> constructor;
PartType( final int baseMetaValue, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c )
{
@@ -186,24 +186,39 @@ public enum PartType
return false;
}
public Set<AEFeature> getFeature()
Set<AEFeature> getFeature()
{
return this.features;
}
public Set<IntegrationType> getIntegrations()
Set<IntegrationType> getIntegrations()
{
return this.integrations;
}
public Class<? extends IPart> getPart()
Class<? extends IPart> getPart()
{
return this.myPart;
}
public GuiText getExtraName()
GuiText getExtraName()
{
return this.extraName;
}
Constructor<? extends IPart> getConstructor()
{
return this.constructor;
}
void setConstructor( final Constructor<? extends IPart> constructor )
{
this.constructor = constructor;
}
int getBaseDamage()
{
return this.baseDamage;
}
}