优化SLOT的结构

This commit is contained in:
bryan.zhang
2017-12-06 14:28:19 +08:00
parent 8cd161a580
commit f2b7601044
2 changed files with 4 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ public abstract class NodeComponent {
return this;
}
public Slot getSlot(){
public <T extends Slot> T getSlot(){
return DataBus.getSlot(this.slotIndexTL.get());
}

View File

@@ -40,8 +40,9 @@ public class DataBus {
return -1;
}
public static Slot getSlot(int slotIndex){
return slots[slotIndex];
@SuppressWarnings("unchecked")
public static <T extends Slot> T getSlot(int slotIndex){
return (T)slots[slotIndex];
}
public static void releaseSlot(int slotIndex){