public void addTileEntityInternal( short index, TileEntity tileEntity ) { if ( this.tileEntities == null ) { this.tileEntities = new Short2ObjectOpenHashMap<>(); } this.tileEntities.put( index, tileEntity ); }
return new Double2ObjectOpenHashMap(map); } else if (oCls.equals(Short.class)) { return new Short2ObjectOpenHashMap(map); } else if (oCls.equals(Byte.class)) { return new Byte2ObjectOpenHashMap(map);
return new Double2ObjectOpenHashMap(map); } else if (oCls.equals(Short.class)) { return new Short2ObjectOpenHashMap(map); } else if (oCls.equals(Byte.class)) { return new Byte2ObjectOpenHashMap(map);
public TemporaryStorage getTemporaryStorage( int x, int y, int z, int layer ) { short index = getIndex( x, y, z ); // Select correct layer Short2ObjectOpenHashMap<TemporaryStorage> storage = this.temporaryStorages[layer]; if ( storage == null ) { storage = new Short2ObjectOpenHashMap<>(); this.temporaryStorages[layer] = storage; } TemporaryStorage blockStorage = storage.get( index ); if ( blockStorage == null ) { blockStorage = new TemporaryStorage(); storage.put( index, blockStorage ); } return blockStorage; }
private Map deserializeMap(final DataInput is) throws IOException, ClassNotFoundException { Object h = deserialize(is); Class oCls = h.getClass(); if (oCls.equals(Integer.class)) { int size = (Integer) h; Object2ObjectOpenHashMap set = new Object2ObjectOpenHashMap(size); for (int i = 0; i < size; i++) { set.put(deserialize(is), deserialize(is)); } return set; } else if (oCls.equals(int[].class)) { return new Int2ObjectOpenHashMap((int[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(float[].class)) { return new Float2ObjectOpenHashMap((float[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(double[].class)) { return new Double2ObjectOpenHashMap((double[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(short[].class)) { return new Short2ObjectOpenHashMap((short[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(byte[].class)) { return new Byte2ObjectOpenHashMap((byte[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(long[].class)) { return new Long2ObjectOpenHashMap((long[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(char[].class)) { return new Char2ObjectOpenHashMap((char[]) h, (Object[]) deserialize(is)); } throw new EOFException(); }
private Map deserializeMap(final DataInput is) throws IOException, ClassNotFoundException { Object h = deserialize(is); Class oCls = h.getClass(); if (oCls.equals(Integer.class)) { int size = (Integer) h; Object2ObjectOpenHashMap set = new Object2ObjectOpenHashMap(size); for (int i = 0; i < size; i++) { set.put(deserialize(is), deserialize(is)); } return set; } else if (oCls.equals(int[].class)) { return new Int2ObjectOpenHashMap((int[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(float[].class)) { return new Float2ObjectOpenHashMap((float[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(double[].class)) { return new Double2ObjectOpenHashMap((double[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(short[].class)) { return new Short2ObjectOpenHashMap((short[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(byte[].class)) { return new Byte2ObjectOpenHashMap((byte[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(long[].class)) { return new Long2ObjectOpenHashMap((long[]) h, (Object[]) deserialize(is)); } else if (oCls.equals(char[].class)) { return new Char2ObjectOpenHashMap((char[]) h, (Object[]) deserialize(is)); } throw new EOFException(); }
public EdgeTypeStore(Configuration config) { if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) { throw new RuntimeException("Edge Type Store size can't exceed 65534"); } this.configuration = config; this.garbageQueue = new ShortRBTreeSet(); this.labelMap = new Object2ShortOpenHashMap(MAX_SIZE); this.idMap = new Short2ObjectOpenHashMap(MAX_SIZE); labelMap.defaultReturnValue(NULL_SHORT); // Add null type short id = intToShort(NULL_LABEL); length++; labelMap.put(null, id); idMap.put(id, null); }
public EdgeTypeStore(Configuration config) { if (MAX_SIZE >= Short.MAX_VALUE - Short.MIN_VALUE + 1) { throw new RuntimeException("Edge Type Store size can't exceed 65534"); } this.configuration = config; this.garbageQueue = new ShortRBTreeSet(); this.labelMap = new Object2ShortOpenHashMap(MAX_SIZE); this.idMap = new Short2ObjectOpenHashMap(MAX_SIZE); labelMap.defaultReturnValue(NULL_SHORT); // Add null type short id = intToShort(NULL_LABEL); length++; labelMap.put(null, id); idMap.put(id, null); }
@Override public void readData(DataIn data) { startX = data.readVarInt(); startZ = data.readVarInt(); claimedChunks = data.readVarInt(); loadedChunks = data.readVarInt(); maxClaimedChunks = data.readVarInt(); maxLoadedChunks = data.readVarInt(); teams = new Short2ObjectOpenHashMap<>(); for (ClientClaimedChunks.Team team : data.readCollection(ClientClaimedChunks.Team.DESERIALIZER)) { teams.put(team.uid, team); } }
teams = new Short2ObjectOpenHashMap<>();