lab6 some minor fixes
This commit is contained in:
parent
a8d164c663
commit
99da8dad3d
@ -4,6 +4,9 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
public class SetGeneric<T extends Object>{
|
public class SetGeneric<T extends Object>{
|
||||||
private final ArrayList<T> places;
|
private final ArrayList<T> places;
|
||||||
|
public int getCount() {
|
||||||
|
return places.size();
|
||||||
|
}
|
||||||
private final int maxCount;
|
private final int maxCount;
|
||||||
public SetGeneric(int count){
|
public SetGeneric(int count){
|
||||||
maxCount = count;
|
maxCount = count;
|
||||||
@ -26,9 +29,6 @@ public class SetGeneric<T extends Object>{
|
|||||||
places.remove(position);
|
places.remove(position);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public int getCount() {
|
|
||||||
return places.size();
|
|
||||||
}
|
|
||||||
public T get(int position){
|
public T get(int position){
|
||||||
if(!(position >= 0 && position < places.size()))
|
if(!(position >= 0 && position < places.size()))
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user