diff --git a/.idea/java.iml b/.idea/java.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/.idea/java.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index 561b3e5..a127731 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/ProjectElectricLocomotive/LocomotiveGenericCollection.java b/ProjectElectricLocomotive/LocomotiveGenericCollection.java index cf1207c..0aeddea 100644 --- a/ProjectElectricLocomotive/LocomotiveGenericCollection.java +++ b/ProjectElectricLocomotive/LocomotiveGenericCollection.java @@ -7,9 +7,11 @@ public class LocomotiveGenericCollection _collection; @@ -24,7 +26,6 @@ public class LocomotiveGenericCollection{ return _places.get(position); } + public T Get(int position) + { + if (position < 0 || position >= Count()) return null; + return _places.get(position); + } + public Iterable GetLocomotives(final Integer maxLocomotives) { return new Iterable() { @Override @@ -80,11 +86,4 @@ public class SetGeneric{ } }; } - -// public T Get(int position) -// { -// // TODO проверка позиции -// if (position < 0 || position >= Count()) return null; -// return _places[position]; -// } } \ No newline at end of file