diff --git a/app/src/main/java/com/example/nemophila/Nemophila.java b/app/src/main/java/com/example/nemophila/Nemophila.java index d87e5e1..887d607 100644 --- a/app/src/main/java/com/example/nemophila/Nemophila.java +++ b/app/src/main/java/com/example/nemophila/Nemophila.java @@ -7,6 +7,9 @@ import com.example.nemophila.entities.Shop; import com.google.type.LatLng; +import java.util.HashMap; +import java.util.HashSet; + public class Nemophila extends Application { private final int MAX_FILTER = 5; @@ -27,8 +30,8 @@ private float zoom; //フィルターのデータ - private String[] selectGenre = new String[MAX_FILTER]; - private Account[] selectFriend = new Account[MAX_FILTER]; + private HashSet selectGenres = new HashSet<>(); + private HashSet selectFriends = new HashSet<>(); //Account関連のGetter public String getName() { @@ -91,11 +94,11 @@ } //フィルター関連のGetter - public String[] getSelectGenre() { - return selectGenre; + public HashSet getSelectGenres() { + return selectGenres; } - public Account[] getSelectFriend() { - return selectFriend; + public HashSet getSelectFriends() { + return selectFriends; } //Setter @@ -151,11 +154,19 @@ this.zoom = zoom; } -// //フィルター関連のSetter -// public void setSelectGenre(String selectGenre) { -// this.selectGenre = selectGenre; -// } -// public void setSelectFriend(Account selectFriend) { -// this.selectFriend = selectFriend; -// } + //フィルター関連のSetter + public void setSelectGenres(String selectGenre) { + this.selectGenres.add(selectGenre); + } + public void setSelectFriends(Account selectFriend) { + this.selectFriends.add(selectFriend); + } + + //フィルターを取り除く + public void removeSelectGenres(String selectGenre){ + this.selectGenres.remove(selectGenre); + } + public void removeSelectFriends(Account selectFriend) { + this.selectFriends.remove(selectFriend); + } }