草庐IT

ValuePairs

全部标签

java - 从对象数组列表中获取最大值?

有没有一种简单的方法可以从对象数组列表中的对象的一个​​字段中获取最大值?例如,在以下对象中,我希望获得Value字段的最高值。示例数组列表,我想从中获取ValuePairs.mValue的最大值。ArrayListourValues=newArrayList();outValues.add(newValuePairs("descr1",20.00));outValues.add(newValuePairs("descr2",40.00));outValues.add(newValuePairs("descr3",50.00));用于创建存储在arraylist中的对象的类:publi