лаба 6 Кувшинов Тимур ПИбд-21 Сложная #8
@ -118,4 +118,6 @@ public class SetGeneric<T extends Object> {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void clear(){ _places.clear(); }
|
||||
}
|
||||
|
@ -132,4 +132,5 @@ public class TrainsGenericCollection<T extends DrawingTrain, U extends IMoveable
|
||||
i++;
|
||||
}
|
||||
}
|
||||
public void clear(){ _collection.clear(); }
|
||||
}
|
||||
|
@ -71,7 +71,14 @@ public class TrainsGenericStorage {
|
||||
if (key == null || key.length() == 0)
|
||||
return false;
|
||||
|
||||
TrainsGenericCollection<DrawingTrain, DrawningObjectTrain> collection = new TrainsGenericCollection<>(_pictureWidth, _pictureHeight);
|
||||
TrainsGenericCollection<DrawingTrain, DrawningObjectTrain> collection;
|
||||
if (_trainStorages.containsKey(key)){
|
||||
collection = _trainStorages.get(key);
|
||||
collection.clear();
|
||||
}
|
||||
else
|
||||
collection = new TrainsGenericCollection<>(_pictureWidth, _pictureHeight);
|
||||
|
||||
List<String> trainsStrings = new ArrayList<String>();
|
||||
|
||||
s = reader.readLine();
|
||||
@ -87,8 +94,6 @@ public class TrainsGenericStorage {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_trainStorages.containsKey(key))
|
||||
_trainStorages.remove(key);
|
||||
_trainStorages.put(key, collection);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user