Clear clear clear .c̸͙̀l̯̞̆ͥ̔͡e͖̳̠ͭ͟ă̾̚r... laba6
This commit is contained in:
parent
9b48716760
commit
a2314a26a6
@ -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++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void clear(){ _collection.clear(); }
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,14 @@ public class TrainsGenericStorage {
|
|||||||
if (key == null || key.length() == 0)
|
if (key == null || key.length() == 0)
|
||||||
return false;
|
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>();
|
List<String> trainsStrings = new ArrayList<String>();
|
||||||
|
|
||||||
s = reader.readLine();
|
s = reader.readLine();
|
||||||
@ -87,8 +94,6 @@ public class TrainsGenericStorage {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_trainStorages.containsKey(key))
|
|
||||||
_trainStorages.remove(key);
|
|
||||||
_trainStorages.put(key, collection);
|
_trainStorages.put(key, collection);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Loading…
Reference in New Issue
Block a user