I have a class
class polygon
{
private String name;
private int quantity;
// default constructor
private polygon()
{ }
public String get name() {
return name;
}
public void setname(String name) {
this.name = name;
}
public int getquantity() {
return quantity;
}
public void setquantity(int quantity) {
this.quantity = quantity;
}
}
and also I have a map like this:
LinkedHashMap<Integer, polygon> polymap = new LinkedHashMap<Integer, polygon>();
I have to ask two questions:
- How can I find if there is a member with specific value which has the name like "square"?
- How can I get all the member with the lowest quantity?
Thanks.