Finally use Java7 <>
This commit is contained in:
@@ -44,8 +44,8 @@ import appeng.util.ReadOnlyCollection;
|
||||
public class Grid implements IGrid
|
||||
{
|
||||
private final NetworkEventBus eventBus = new NetworkEventBus();
|
||||
private final Map<Class<? extends IGridHost>, MachineSet> machines = new HashMap<Class<? extends IGridHost>, MachineSet>();
|
||||
private final Map<Class<? extends IGridCache>, GridCacheWrapper> caches = new HashMap<Class<? extends IGridCache>, GridCacheWrapper>();
|
||||
private final Map<Class<? extends IGridHost>, MachineSet> machines = new HashMap<>();
|
||||
private final Map<Class<? extends IGridCache>, GridCacheWrapper> caches = new HashMap<>();
|
||||
private GridNode pivot;
|
||||
private int priority; // how import is this network?
|
||||
private GridStorage myStorage;
|
||||
@@ -233,7 +233,7 @@ public class Grid implements IGrid
|
||||
{
|
||||
final Set<Class<? extends IGridHost>> machineKeys = this.machines.keySet();
|
||||
|
||||
return new ReadOnlyCollection<Class<? extends IGridHost>>( machineKeys );
|
||||
return new ReadOnlyCollection<>( machineKeys );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -242,7 +242,7 @@ public class GridConnection implements IGridConnection, IPathItem
|
||||
@Override
|
||||
public IReadOnlyCollection<IPathItem> getPossibleOptions()
|
||||
{
|
||||
return new ReadOnlyCollection<IPathItem>( Arrays.asList( (IPathItem) this.a(), (IPathItem) this.b() ) );
|
||||
return new ReadOnlyCollection<>( Arrays.asList( (IPathItem) this.a(), (IPathItem) this.b() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,7 +62,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged();
|
||||
private static final int[] CHANNEL_COUNT = { 0, 8, 32 };
|
||||
|
||||
private final List<IGridConnection> connections = new LinkedList<IGridConnection>();
|
||||
private final List<IGridConnection> connections = new LinkedList<>();
|
||||
private final IGridBlock gridProxy;
|
||||
// old power draw, used to diff
|
||||
private double previousDraw = 0.0;
|
||||
@@ -161,14 +161,14 @@ public class GridNode implements IGridNode, IPathItem
|
||||
{
|
||||
final Object tracker = new Object();
|
||||
|
||||
LinkedList<GridNode> nextRun = new LinkedList<GridNode>();
|
||||
LinkedList<GridNode> nextRun = new LinkedList<>();
|
||||
nextRun.add( this );
|
||||
|
||||
this.visitorIterationNumber = tracker;
|
||||
|
||||
if( g instanceof IGridConnectionVisitor )
|
||||
{
|
||||
final LinkedList<IGridConnection> nextConn = new LinkedList<IGridConnection>();
|
||||
final LinkedList<IGridConnection> nextConn = new LinkedList<>();
|
||||
final IGridConnectionVisitor gcv = (IGridConnectionVisitor) g;
|
||||
|
||||
while( !nextRun.isEmpty() )
|
||||
@@ -179,7 +179,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
}
|
||||
|
||||
final Iterable<GridNode> thisRun = nextRun;
|
||||
nextRun = new LinkedList<GridNode>();
|
||||
nextRun = new LinkedList<>();
|
||||
|
||||
for( final GridNode n : thisRun )
|
||||
{
|
||||
@@ -192,7 +192,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
while( !nextRun.isEmpty() )
|
||||
{
|
||||
final Iterable<GridNode> thisRun = nextRun;
|
||||
nextRun = new LinkedList<GridNode>();
|
||||
nextRun = new LinkedList<>();
|
||||
|
||||
for( final GridNode n : thisRun )
|
||||
{
|
||||
@@ -301,7 +301,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
@Override
|
||||
public IReadOnlyCollection<IGridConnection> getConnections()
|
||||
{
|
||||
return new ReadOnlyCollection<IGridConnection>( this.connections );
|
||||
return new ReadOnlyCollection<>( this.connections );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ public class GridStorage implements IGridStorage
|
||||
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>();
|
||||
private final WeakHashMap<GridStorage, Boolean> divided = new WeakHashMap<>();
|
||||
private WeakReference<IGrid> internalGrid = null;
|
||||
|
||||
// lost...
|
||||
@@ -123,7 +123,7 @@ public class GridStorage implements IGridStorage
|
||||
|
||||
void setGrid( final Grid grid )
|
||||
{
|
||||
this.internalGrid = new WeakReference<IGrid>( grid );
|
||||
this.internalGrid = new WeakReference<>( grid );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,8 +36,8 @@ import appeng.core.AELog;
|
||||
|
||||
public class NetworkEventBus
|
||||
{
|
||||
private static final Collection<Class> READ_CLASSES = new HashSet<Class>();
|
||||
private static final Map<Class<? extends MENetworkEvent>, Map<Class, MENetworkEventInfo>> EVENTS = new HashMap<Class<? extends MENetworkEvent>, Map<Class, MENetworkEventInfo>>();
|
||||
private static final Collection<Class> READ_CLASSES = new HashSet<>();
|
||||
private static final Map<Class<? extends MENetworkEvent>, Map<Class, MENetworkEventInfo>> EVENTS = new HashMap<>();
|
||||
|
||||
void readClass( final Class listAs, final Class c )
|
||||
{
|
||||
@@ -63,7 +63,7 @@ public class NetworkEventBus
|
||||
Map<Class, MENetworkEventInfo> classEvents = EVENTS.get( types[0] );
|
||||
if( classEvents == null )
|
||||
{
|
||||
EVENTS.put( types[0], classEvents = new HashMap<Class, MENetworkEventInfo>() );
|
||||
EVENTS.put( types[0], classEvents = new HashMap<>() );
|
||||
}
|
||||
|
||||
MENetworkEventInfo thisEvent = classEvents.get( listAs );
|
||||
@@ -201,7 +201,7 @@ public class NetworkEventBus
|
||||
private class MENetworkEventInfo
|
||||
{
|
||||
|
||||
private final List<EventMethod> methods = new ArrayList<EventMethod>();
|
||||
private final List<EventMethod> methods = new ArrayList<>();
|
||||
|
||||
private void Add( final Class Event, final Class ObjClass, final Method ObjMethod )
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ import java.util.List;
|
||||
public class NetworkList implements Collection<Grid>
|
||||
{
|
||||
|
||||
private List<Grid> networks = new LinkedList<Grid>();
|
||||
private List<Grid> networks = new LinkedList<>();
|
||||
|
||||
@Override
|
||||
public int size()
|
||||
@@ -108,6 +108,6 @@ public class NetworkList implements Collection<Grid>
|
||||
@Override
|
||||
public void clear()
|
||||
{
|
||||
this.networks = new LinkedList<Grid>();
|
||||
this.networks = new LinkedList<>();
|
||||
}
|
||||
}
|
||||
|
||||
+13
-13
@@ -114,16 +114,16 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
CRAFTING_POOL = Executors.newCachedThreadPool( factory );
|
||||
}
|
||||
|
||||
private final Set<CraftingCPUCluster> craftingCPUClusters = new HashSet<CraftingCPUCluster>();
|
||||
private final Set<ICraftingProvider> craftingProviders = new HashSet<ICraftingProvider>();
|
||||
private final Map<IGridNode, ICraftingWatcher> craftingWatchers = new HashMap<IGridNode, ICraftingWatcher>();
|
||||
private final Set<CraftingCPUCluster> craftingCPUClusters = new HashSet<>();
|
||||
private final Set<ICraftingProvider> craftingProviders = new HashSet<>();
|
||||
private final Map<IGridNode, ICraftingWatcher> craftingWatchers = new HashMap<>();
|
||||
private final IGrid grid;
|
||||
private final Map<ICraftingPatternDetails, List<ICraftingMedium>> craftingMethods = new HashMap<ICraftingPatternDetails, List<ICraftingMedium>>();
|
||||
private final Map<IAEItemStack, ImmutableList<ICraftingPatternDetails>> craftableItems = new HashMap<IAEItemStack, ImmutableList<ICraftingPatternDetails>>();
|
||||
private final Set<IAEItemStack> emitableItems = new HashSet<IAEItemStack>();
|
||||
private final Map<String, CraftingLinkNexus> craftingLinks = new HashMap<String, CraftingLinkNexus>();
|
||||
private final Map<ICraftingPatternDetails, List<ICraftingMedium>> craftingMethods = new HashMap<>();
|
||||
private final Map<IAEItemStack, ImmutableList<ICraftingPatternDetails>> craftableItems = new HashMap<>();
|
||||
private final Set<IAEItemStack> emitableItems = new HashSet<>();
|
||||
private final Map<String, CraftingLinkNexus> craftingLinks = new HashMap<>();
|
||||
private final Multimap<IAEStack, CraftingWatcher> interests = HashMultimap.create();
|
||||
private final GenericInterestManager<CraftingWatcher> interestManager = new GenericInterestManager<CraftingWatcher>( this.interests );
|
||||
private final GenericInterestManager<CraftingWatcher> interestManager = new GenericInterestManager<>( this.interests );
|
||||
private IStorageGrid storageGrid;
|
||||
private IEnergyGrid energyGrid;
|
||||
private boolean updateList = false;
|
||||
@@ -271,7 +271,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
provider.provideCrafting( this );
|
||||
}
|
||||
|
||||
final Map<IAEItemStack, Set<ICraftingPatternDetails>> tmpCraft = new HashMap<IAEItemStack, Set<ICraftingPatternDetails>>();
|
||||
final Map<IAEItemStack, Set<ICraftingPatternDetails>> tmpCraft = new HashMap<>();
|
||||
|
||||
// new craftables!
|
||||
for( final ICraftingPatternDetails details : this.craftingMethods.keySet() )
|
||||
@@ -286,7 +286,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
|
||||
if( methods == null )
|
||||
{
|
||||
tmpCraft.put( out, methods = new TreeSet<ICraftingPatternDetails>( COMPARATOR ) );
|
||||
tmpCraft.put( out, methods = new TreeSet<>( COMPARATOR ) );
|
||||
}
|
||||
|
||||
methods.add( details );
|
||||
@@ -357,7 +357,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
List<ICraftingMedium> details = this.craftingMethods.get( api );
|
||||
if( details == null )
|
||||
{
|
||||
details = new ArrayList<ICraftingMedium>();
|
||||
details = new ArrayList<>();
|
||||
details.add( medium );
|
||||
this.craftingMethods.put( api, details );
|
||||
}
|
||||
@@ -376,7 +376,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
@Override
|
||||
public List<IMEInventoryHandler> getCellArray( final StorageChannel channel )
|
||||
{
|
||||
final List<IMEInventoryHandler> list = new ArrayList<IMEInventoryHandler>( 1 );
|
||||
final List<IMEInventoryHandler> list = new ArrayList<>( 1 );
|
||||
|
||||
if( channel == StorageChannel.ITEMS )
|
||||
{
|
||||
@@ -527,7 +527,7 @@ public class CraftingGridCache implements ICraftingGrid, ICraftingProviderHelper
|
||||
|
||||
if( target == null )
|
||||
{
|
||||
final List<CraftingCPUCluster> validCpusClusters = new ArrayList<CraftingCPUCluster>();
|
||||
final List<CraftingCPUCluster> validCpusClusters = new ArrayList<>();
|
||||
for( final CraftingCPUCluster cpu : this.craftingCPUClusters )
|
||||
{
|
||||
if( cpu.isActive() && !cpu.isBusy() && cpu.getAvailableStorage() >= job.getByteTotal() )
|
||||
|
||||
+5
-5
@@ -61,12 +61,12 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
|
||||
private final NavigableSet<EnergyThreshold> interests = Sets.newTreeSet();
|
||||
private final double averageLength = 40.0;
|
||||
private final Set<IAEPowerStorage> providers = new LinkedHashSet<IAEPowerStorage>();
|
||||
private final Set<IAEPowerStorage> requesters = new LinkedHashSet<IAEPowerStorage>();
|
||||
private final Set<IAEPowerStorage> providers = new LinkedHashSet<>();
|
||||
private final Set<IAEPowerStorage> requesters = new LinkedHashSet<>();
|
||||
private final Multiset<IEnergyGridProvider> energyGridProviders = HashMultiset.create();
|
||||
private final IGrid myGrid;
|
||||
private final HashMap<IGridNode, IEnergyWatcher> watchers = new HashMap<IGridNode, IEnergyWatcher>();
|
||||
private final Set<IEnergyGrid> localSeen = new HashSet<IEnergyGrid>();
|
||||
private final HashMap<IGridNode, IEnergyWatcher> watchers = new HashMap<>();
|
||||
private final Set<IEnergyGrid> localSeen = new HashSet<>();
|
||||
/**
|
||||
* estimated power available.
|
||||
*/
|
||||
@@ -354,7 +354,7 @@ public class EnergyGridCache implements IEnergyGrid
|
||||
while( amt > 0 && i.hasNext() )
|
||||
{
|
||||
final IEnergyGridProvider what = i.next();
|
||||
final Set<IEnergyGrid> listCopy = new HashSet<IEnergyGrid>();
|
||||
final Set<IEnergyGrid> listCopy = new HashSet<>();
|
||||
listCopy.addAll( seen );
|
||||
|
||||
final double cannotHold = what.injectAEPower( amt, Actionable.SIMULATE, listCopy );
|
||||
|
||||
+9
-9
@@ -59,13 +59,13 @@ public class GridStorageCache implements IStorageGrid
|
||||
{
|
||||
|
||||
private final IGrid myGrid;
|
||||
private final HashSet<ICellProvider> activeCellProviders = new HashSet<ICellProvider>();
|
||||
private final HashSet<ICellProvider> inactiveCellProviders = new HashSet<ICellProvider>();
|
||||
private final HashSet<ICellProvider> activeCellProviders = new HashSet<>();
|
||||
private final HashSet<ICellProvider> inactiveCellProviders = new HashSet<>();
|
||||
private final SetMultimap<IAEStack, ItemWatcher> interests = HashMultimap.create();
|
||||
private final GenericInterestManager<ItemWatcher> interestManager = new GenericInterestManager<ItemWatcher>( this.interests );
|
||||
private final NetworkMonitor<IAEItemStack> itemMonitor = new NetworkMonitor<IAEItemStack>( this, StorageChannel.ITEMS );
|
||||
private final NetworkMonitor<IAEFluidStack> fluidMonitor = new NetworkMonitor<IAEFluidStack>( this, StorageChannel.FLUIDS );
|
||||
private final HashMap<IGridNode, IStackWatcher> watchers = new HashMap<IGridNode, IStackWatcher>();
|
||||
private final GenericInterestManager<ItemWatcher> interestManager = new GenericInterestManager<>( this.interests );
|
||||
private final NetworkMonitor<IAEItemStack> itemMonitor = new NetworkMonitor<>( this, StorageChannel.ITEMS );
|
||||
private final NetworkMonitor<IAEFluidStack> fluidMonitor = new NetworkMonitor<>( this, StorageChannel.FLUIDS );
|
||||
private final HashMap<IGridNode, IStackWatcher> watchers = new HashMap<>();
|
||||
private NetworkInventoryHandler<IAEItemStack> myItemNetwork;
|
||||
private NetworkInventoryHandler<IAEFluidStack> myFluidNetwork;
|
||||
|
||||
@@ -284,7 +284,7 @@ public class GridStorageCache implements IStorageGrid
|
||||
switch( chan )
|
||||
{
|
||||
case FLUIDS:
|
||||
this.myFluidNetwork = new NetworkInventoryHandler<IAEFluidStack>( StorageChannel.FLUIDS, security );
|
||||
this.myFluidNetwork = new NetworkInventoryHandler<>( StorageChannel.FLUIDS, security );
|
||||
for( final ICellProvider cc : this.activeCellProviders )
|
||||
{
|
||||
for( final IMEInventoryHandler<IAEFluidStack> h : cc.getCellArray( chan ) )
|
||||
@@ -294,7 +294,7 @@ public class GridStorageCache implements IStorageGrid
|
||||
}
|
||||
break;
|
||||
case ITEMS:
|
||||
this.myItemNetwork = new NetworkInventoryHandler<IAEItemStack>( StorageChannel.ITEMS, security );
|
||||
this.myItemNetwork = new NetworkInventoryHandler<>( StorageChannel.ITEMS, security );
|
||||
for( final ICellProvider cc : this.activeCellProviders )
|
||||
{
|
||||
for( final IMEInventoryHandler<IAEItemStack> h : cc.getCellArray( chan ) )
|
||||
@@ -402,7 +402,7 @@ public class GridStorageCache implements IStorageGrid
|
||||
private class CellChangeTracker
|
||||
{
|
||||
|
||||
final List<CellChangeTrackerRecord> data = new LinkedList<CellChangeTrackerRecord>();
|
||||
final List<CellChangeTrackerRecord> data = new LinkedList<>();
|
||||
|
||||
public void postChanges( final StorageChannel channel, final int i, final IMEInventoryHandler<? extends IAEStack> h, final BaseActionSource actionSrc )
|
||||
{
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public class NetworkMonitor<T extends IAEStack<T>> implements IMEMonitor<T>
|
||||
this.myGridCache = cache;
|
||||
this.myChannel = chan;
|
||||
this.cachedList = (IItemList<T>) chan.createList();
|
||||
this.listeners = new HashMap<IMEMonitorHandlerReceiver<T>, Object>();
|
||||
this.listeners = new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -43,9 +43,9 @@ public class P2PCache implements IGridCache
|
||||
{
|
||||
|
||||
private final IGrid myGrid;
|
||||
private final HashMap<Long, PartP2PTunnel> inputs = new HashMap<Long, PartP2PTunnel>();
|
||||
private final HashMap<Long, PartP2PTunnel> inputs = new HashMap<>();
|
||||
private final Multimap<Long, PartP2PTunnel> outputs = LinkedHashMultimap.create();
|
||||
private final TunnelCollection NullColl = new TunnelCollection<PartP2PTunnel>( null, null );
|
||||
private final TunnelCollection NullColl = new TunnelCollection<>( null, null );
|
||||
|
||||
public P2PCache( final IGrid g )
|
||||
{
|
||||
|
||||
+9
-9
@@ -58,10 +58,10 @@ import appeng.tile.networking.TileController;
|
||||
public class PathGridCache implements IPathingGrid
|
||||
{
|
||||
|
||||
private final LinkedList<PathSegment> active = new LinkedList<PathSegment>();
|
||||
private final Set<TileController> controllers = new HashSet<TileController>();
|
||||
private final Set<IGridNode> requireChannels = new HashSet<IGridNode>();
|
||||
private final Set<IGridNode> blockDense = new HashSet<IGridNode>();
|
||||
private final LinkedList<PathSegment> active = new LinkedList<>();
|
||||
private final Set<TileController> controllers = new HashSet<>();
|
||||
private final Set<IGridNode> requireChannels = new HashSet<>();
|
||||
private final Set<IGridNode> blockDense = new HashSet<>();
|
||||
private final IGrid myGrid;
|
||||
private int channelsInUse = 0;
|
||||
private int channelsByBlocks = 0;
|
||||
@@ -72,7 +72,7 @@ public class PathGridCache implements IPathingGrid
|
||||
private ControllerState controllerState = ControllerState.NO_CONTROLLER;
|
||||
private int ticksUntilReady = 20;
|
||||
private int lastChannels = 0;
|
||||
private HashSet<IPathItem> semiOpen = new HashSet<IPathItem>();
|
||||
private HashSet<IPathItem> semiOpen = new HashSet<>();
|
||||
|
||||
public PathGridCache( final IGrid g )
|
||||
{
|
||||
@@ -136,8 +136,8 @@ public class PathGridCache implements IPathingGrid
|
||||
{
|
||||
final int nodes = this.myGrid.getNodes().size();
|
||||
this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 );
|
||||
final HashSet<IPathItem> closedList = new HashSet<IPathItem>();
|
||||
this.semiOpen = new HashSet<IPathItem>();
|
||||
final HashSet<IPathItem> closedList = new HashSet<>();
|
||||
this.semiOpen = new HashSet<>();
|
||||
|
||||
// myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 )
|
||||
// );
|
||||
@@ -149,7 +149,7 @@ public class PathGridCache implements IPathingGrid
|
||||
final GridConnection gc = (GridConnection) gcc;
|
||||
if( !( gc.getOtherSide( node ).getMachine() instanceof TileController ) )
|
||||
{
|
||||
final List<IPathItem> open = new LinkedList<IPathItem>();
|
||||
final List<IPathItem> open = new LinkedList<>();
|
||||
closedList.add( gc );
|
||||
open.add( gc );
|
||||
gc.setControllerRoute( (GridNode) node, true );
|
||||
@@ -344,7 +344,7 @@ public class PathGridCache implements IPathingGrid
|
||||
final Achievements lastBracket = this.getAchievementBracket( this.lastChannels );
|
||||
if( currentBracket != lastBracket && currentBracket != null )
|
||||
{
|
||||
final Set<Integer> players = new HashSet<Integer>();
|
||||
final Set<Integer> players = new HashSet<>();
|
||||
for( final IGridNode n : this.requireChannels )
|
||||
{
|
||||
players.add( n.getPlayerID() );
|
||||
|
||||
+2
-2
@@ -46,8 +46,8 @@ public class SecurityCache implements ISecurityGrid
|
||||
{
|
||||
|
||||
private final IGrid myGrid;
|
||||
private final List<ISecurityProvider> securityProvider = new ArrayList<ISecurityProvider>();
|
||||
private final HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms = new HashMap<Integer, EnumSet<SecurityPermissions>>();
|
||||
private final List<ISecurityProvider> securityProvider = new ArrayList<>();
|
||||
private final HashMap<Integer, EnumSet<SecurityPermissions>> playerPerms = new HashMap<>();
|
||||
private long securityKey = -1;
|
||||
|
||||
public SecurityCache( final IGrid g )
|
||||
|
||||
+4
-4
@@ -47,8 +47,8 @@ public class SpatialPylonCache implements ISpatialCache
|
||||
private DimensionalCoord captureMin;
|
||||
private DimensionalCoord captureMax;
|
||||
private boolean isValid = false;
|
||||
private List<TileSpatialIOPort> ioPorts = new LinkedList<TileSpatialIOPort>();
|
||||
private HashMap<SpatialPylonCluster, SpatialPylonCluster> clusters = new HashMap<SpatialPylonCluster, SpatialPylonCluster>();
|
||||
private List<TileSpatialIOPort> ioPorts = new LinkedList<>();
|
||||
private HashMap<SpatialPylonCluster, SpatialPylonCluster> clusters = new HashMap<>();
|
||||
|
||||
public SpatialPylonCache( final IGrid g )
|
||||
{
|
||||
@@ -64,8 +64,8 @@ public class SpatialPylonCache implements ISpatialCache
|
||||
private void reset( final IGrid grid )
|
||||
{
|
||||
|
||||
this.clusters = new HashMap<SpatialPylonCluster, SpatialPylonCluster>();
|
||||
this.ioPorts = new LinkedList<TileSpatialIOPort>();
|
||||
this.clusters = new HashMap<>();
|
||||
this.ioPorts = new LinkedList<>();
|
||||
|
||||
for( final IGridNode gm : grid.getMachines( TileSpatialIOPort.class ) )
|
||||
{
|
||||
|
||||
+4
-4
@@ -41,10 +41,10 @@ public class TickManagerCache implements ITickManager
|
||||
{
|
||||
|
||||
private final IGrid myGrid;
|
||||
private final HashMap<IGridNode, TickTracker> alertable = new HashMap<IGridNode, TickTracker>();
|
||||
private final HashMap<IGridNode, TickTracker> sleeping = new HashMap<IGridNode, TickTracker>();
|
||||
private final HashMap<IGridNode, TickTracker> awake = new HashMap<IGridNode, TickTracker>();
|
||||
private final PriorityQueue<TickTracker> upcomingTicks = new PriorityQueue<TickTracker>();
|
||||
private final HashMap<IGridNode, TickTracker> alertable = new HashMap<>();
|
||||
private final HashMap<IGridNode, TickTracker> sleeping = new HashMap<>();
|
||||
private final HashMap<IGridNode, TickTracker> awake = new HashMap<>();
|
||||
private final PriorityQueue<TickTracker> upcomingTicks = new PriorityQueue<>();
|
||||
private long currentTick = 0;
|
||||
|
||||
public TickManagerCache( final IGrid g )
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ import appeng.util.IWorldCallable;
|
||||
public class Connections implements IWorldCallable<Void>
|
||||
{
|
||||
|
||||
private final HashMap<IGridNode, TunnelConnection> connections = new HashMap<IGridNode, TunnelConnection>();
|
||||
private final HashMap<IGridNode, TunnelConnection> connections = new HashMap<>();
|
||||
private final PartP2PTunnelME me;
|
||||
private boolean create = false;
|
||||
private boolean destroy = false;
|
||||
|
||||
@@ -53,9 +53,9 @@ public class TunnelCollection<T extends PartP2PTunnel> implements Iterable<T>
|
||||
{
|
||||
if( this.tunnelSources == null )
|
||||
{
|
||||
return new NullIterator<T>();
|
||||
return new NullIterator<>();
|
||||
}
|
||||
return new TunnelIterator<T>( this.tunnelSources, this.clz );
|
||||
return new TunnelIterator<>( this.tunnelSources, this.clz );
|
||||
}
|
||||
|
||||
public boolean matches( final Class<? extends PartP2PTunnel> c )
|
||||
|
||||
@@ -87,12 +87,12 @@ public final class CraftingCPUCluster implements IAECluster, ICraftingCPU
|
||||
private final WorldCoord min;
|
||||
private final WorldCoord max;
|
||||
private final int[] usedOps = new int[3];
|
||||
private final Map<ICraftingPatternDetails, TaskProgress> tasks = new HashMap<ICraftingPatternDetails, TaskProgress>();
|
||||
private final Map<ICraftingPatternDetails, TaskProgress> tasks = new HashMap<>();
|
||||
// INSTANCE sate
|
||||
private final LinkedList<TileCraftingTile> tiles = new LinkedList<TileCraftingTile>();
|
||||
private final LinkedList<TileCraftingTile> storage = new LinkedList<TileCraftingTile>();
|
||||
private final LinkedList<TileCraftingMonitorTile> status = new LinkedList<TileCraftingMonitorTile>();
|
||||
private final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object>();
|
||||
private final LinkedList<TileCraftingTile> tiles = new LinkedList<>();
|
||||
private final LinkedList<TileCraftingTile> storage = new LinkedList<>();
|
||||
private final LinkedList<TileCraftingMonitorTile> status = new LinkedList<>();
|
||||
private final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap<>();
|
||||
private ICraftingLink myLastLink;
|
||||
private String myName = "";
|
||||
private boolean isDestroyed = false;
|
||||
|
||||
@@ -260,7 +260,7 @@ public class QuantumCluster implements ILocatable, IAECluster
|
||||
@Override
|
||||
public Iterator<IGridHost> getTiles()
|
||||
{
|
||||
return new ChainedIterator<IGridHost>( this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3], this.getRing()[4], this
|
||||
return new ChainedIterator<>( this.getRing()[0], this.getRing()[1], this.getRing()[2], this.getRing()[3], this.getRing()[4], this
|
||||
.getRing()[5], this.getRing()[6], this.getRing()[7], this.center );
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class SpatialPylonCluster implements IAECluster
|
||||
|
||||
private final DimensionalCoord min;
|
||||
private final DimensionalCoord max;
|
||||
private final List<TileSpatialPylon> line = new ArrayList<TileSpatialPylon>();
|
||||
private final List<TileSpatialPylon> line = new ArrayList<>();
|
||||
private boolean isDestroyed = false;
|
||||
|
||||
private Axis currentAxis = Axis.UNFORMED;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class EnergyWatcher implements IEnergyWatcher
|
||||
|
||||
private final EnergyGridCache gsc;
|
||||
private final IEnergyWatcherHost watcherHost;
|
||||
private final Set<EnergyThreshold> myInterests = new HashSet<EnergyThreshold>();
|
||||
private final Set<EnergyThreshold> myInterests = new HashSet<>();
|
||||
|
||||
public EnergyWatcher( final EnergyGridCache cache, final IEnergyWatcherHost host )
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ public class AENetworkProxyMultiblock extends AENetworkProxy implements IGridMul
|
||||
{
|
||||
if( this.getCluster() == null )
|
||||
{
|
||||
return new ChainedIterator<IGridNode>();
|
||||
return new ChainedIterator<>();
|
||||
}
|
||||
|
||||
return new ProxyNodeIterator( this.getCluster().getTiles() );
|
||||
|
||||
@@ -43,7 +43,7 @@ public class GenericInterestManager<T>
|
||||
{
|
||||
if( this.transDepth == 0 )
|
||||
{
|
||||
this.transactions = new LinkedList<SavedTransactions>();
|
||||
this.transactions = new LinkedList<>();
|
||||
}
|
||||
|
||||
this.transDepth++;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class PathSegment
|
||||
public boolean step()
|
||||
{
|
||||
final List<IPathItem> oldOpen = this.open;
|
||||
this.open = new LinkedList<IPathItem>();
|
||||
this.open = new LinkedList<>();
|
||||
|
||||
for( final IPathItem i : oldOpen )
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ public class CellInventory implements ICellInventory
|
||||
private static final String ITEM_PRE_FORMATTED_SLOT = "PF#";
|
||||
private static final String ITEM_PRE_FORMATTED_NAME = "PN";
|
||||
private static final String ITEM_PRE_FORMATTED_FUZZY = "FP";
|
||||
private static final HashSet<Integer> BLACK_LIST = new HashSet<Integer>();
|
||||
private static final HashSet<Integer> BLACK_LIST = new HashSet<>();
|
||||
private static String[] itemSlots;
|
||||
private static String[] itemSlotCount;
|
||||
private final NBTTagCompound tagCompound;
|
||||
|
||||
@@ -96,11 +96,11 @@ public class CellInventoryHandler extends MEInventoryHandler<IAEItemStack> imple
|
||||
{
|
||||
if( hasFuzzy )
|
||||
{
|
||||
this.setPartitionList( new FuzzyPriorityList<IAEItemStack>( priorityList, fzMode ) );
|
||||
this.setPartitionList( new FuzzyPriorityList<>( priorityList, fzMode ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setPartitionList( new PrecisePriorityList<IAEItemStack>( priorityList ) );
|
||||
this.setPartitionList( new PrecisePriorityList<>( priorityList ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ItemWatcher implements IStackWatcher
|
||||
|
||||
private final GridStorageCache gsc;
|
||||
private final IStackWatcherHost myObject;
|
||||
private final Set<IAEStack> myInterests = new HashSet<IAEStack>();
|
||||
private final Set<IAEStack> myInterests = new HashSet<>();
|
||||
|
||||
public ItemWatcher( final GridStorageCache cache, final IStackWatcherHost host )
|
||||
{
|
||||
|
||||
@@ -53,13 +53,13 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||
}
|
||||
else
|
||||
{
|
||||
this.internal = new MEPassThrough<T>( i, channel );
|
||||
this.internal = new MEPassThrough<>( i, channel );
|
||||
}
|
||||
|
||||
this.myPriority = 0;
|
||||
this.myWhitelist = IncludeExclude.WHITELIST;
|
||||
this.setBaseAccess( AccessRestriction.READ_WRITE );
|
||||
this.myPartitionList = new DefaultPriorityList<T>();
|
||||
this.myPartitionList = new DefaultPriorityList<>();
|
||||
}
|
||||
|
||||
IncludeExclude getWhitelist()
|
||||
|
||||
@@ -49,7 +49,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
|
||||
|
||||
private final InventoryAdaptor adaptor;
|
||||
private final IItemList<IAEItemStack> list = AEApi.instance().storage().createItemList();
|
||||
private final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object>();
|
||||
private final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap<>();
|
||||
private final NavigableMap<Integer, CachedItemStack> memory;
|
||||
private BaseActionSource mySource;
|
||||
private StorageFilter mode = StorageFilter.EXTRACTABLE_ONLY;
|
||||
@@ -57,7 +57,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
|
||||
public MEMonitorIInventory( final InventoryAdaptor adaptor )
|
||||
{
|
||||
this.adaptor = adaptor;
|
||||
this.memory = new ConcurrentSkipListMap<Integer, CachedItemStack>();
|
||||
this.memory = new ConcurrentSkipListMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -143,7 +143,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
|
||||
public TickRateModulation onTick()
|
||||
{
|
||||
|
||||
final LinkedList<IAEItemStack> changes = new LinkedList<IAEItemStack>();
|
||||
final LinkedList<IAEItemStack> changes = new LinkedList<>();
|
||||
|
||||
this.list.resetStatus();
|
||||
int high = 0;
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.util.inv.ItemListIgnoreCrafting;
|
||||
public class MEMonitorPassThrough<T extends IAEStack<T>> extends MEPassThrough<T> implements IMEMonitor<T>, IMEMonitorHandlerReceiver<T>
|
||||
{
|
||||
|
||||
private final HashMap<IMEMonitorHandlerReceiver<T>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<T>, Object>();
|
||||
private final HashMap<IMEMonitorHandlerReceiver<T>, Object> listeners = new HashMap<>();
|
||||
private BaseActionSource changeSource;
|
||||
private IMEMonitor<T> monitor;
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ import appeng.util.ItemSorters;
|
||||
public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHandler<T>
|
||||
{
|
||||
|
||||
private static final ThreadLocal<LinkedList> DEPTH_MOD = new ThreadLocal<LinkedList>();
|
||||
private static final ThreadLocal<LinkedList> DEPTH_SIM = new ThreadLocal<LinkedList>();
|
||||
private static final ThreadLocal<LinkedList> DEPTH_MOD = new ThreadLocal<>();
|
||||
private static final ThreadLocal<LinkedList> DEPTH_SIM = new ThreadLocal<>();
|
||||
private static final Comparator<Integer> PRIORITY_SORTER = ( o1, o2 ) -> ItemSorters.compareInt( o2, o1 );
|
||||
|
||||
private static int currentPass = 0;
|
||||
|
||||
Reference in New Issue
Block a user