当前位置: 首页 > news >正文

专题网站建设意义何在微信crm系统软件

专题网站建设意义何在,微信crm系统软件,方太官方网站的建设情况,网站设计 配色前言&#xff1a; TreeMap普通的排序方法都是根据键来比较来排序&#xff0c;本篇文章实现两种方式实现值排序 1.使用 SortedSet 和 Stream API 如果你想要一个持久化的排序结果&#xff0c;你可以使用 SortedSet 结构来存储键值对的条目。 TreeSet<Map.Entry<String, …

 前言:

TreeMap普通的排序方法都是根据键来比较来排序,本篇文章实现两种方式实现值排序

1.使用 SortedSet 和 Stream API

如果你想要一个持久化的排序结果,你可以使用 SortedSet 结构来存储键值对的条目。

TreeSet<Map.Entry<String, Person>> set = new TreeSet<>(Map.Entry.comparingByValue());set.add(new AbstractMap.SimpleEntry<>("A", new Person("Alice", 25)));
set.add(new AbstractMap.SimpleEntry<>("B", new Person("Bob", 20)));
set.add(new AbstractMap.SimpleEntry<>("C", new Person("Charlie", 30)));// 打印排序后的条目
for (Map.Entry<String, Person> entry : set) {System.out.println(entry.getKey() + ": " + entry.getValue());
}

这里的Map.Entry.comparingByValue() 方法是根据映射条目的值 (value) 进行排序。这个方法返回一个 Comparator 实例,该实例会比较 Map.Entry 对象中的值。

2. 使用反向映射

如果你只需要临时性的根据值进行排序,并且值的类型实现了 Comparable 接口或者你可以提供一个适当的 Comparator,那么可以创建一个反向映射,即把原来的键值对反转过来。

// 假设我们有一个 Person 类,其中的 name 属性实现了 Comparable 接口
class Person implements Comparable<Person> {private String name;private int age;public Person(String name, int age) {this.name = name;this.age = age;}public String getName() {return name;}public int getAge() {return age;}@Overridepublic int compareTo(Person other) {return this.name.compareTo(other.name);  // 按名字排序}@Overridepublic String toString() {return name + ":" + age;}
}// 使用反向映射
TreeMap<String, Person> reverseMap = new TreeMap<>();reverseMap.put("A", new Person("Alice", 25));
reverseMap.put("B", new Person("Bob", 20));
reverseMap.put("C", new Person("Charlie", 30));// 打印反转后的映射
for (Map.Entry<String, Person> entry : reverseMap.entrySet()) {System.out.println(entry.getKey() + ": " + entry.getValue());
}// 现在我们想按 Person 的 name 排序
TreeMap<Person, String> mapByValue = new TreeMap<>(Comparator.naturalOrder());// 将键值对反转
for (Map.Entry<String, Person> entry : reverseMap.entrySet()) {mapByValue.put(entry.getValue(), entry.getKey());
}// 打印按 Person 的 name 排序后的映射
for (Map.Entry<Person, String> entry : mapByValue.entrySet()) {System.out.println(entry.getKey() + ": " + entry.getValue());
}

文章转载自:
http://dinncocuprite.tpps.cn
http://dinncoperceive.tpps.cn
http://dinncobrecciate.tpps.cn
http://dinncoscaffolding.tpps.cn
http://dinncochestertonian.tpps.cn
http://dinncogeophone.tpps.cn
http://dinncochippewa.tpps.cn
http://dinncoanencephalia.tpps.cn
http://dinncoaias.tpps.cn
http://dinncomistreat.tpps.cn
http://dinncocrawk.tpps.cn
http://dinncolabialpipe.tpps.cn
http://dinncopantagraph.tpps.cn
http://dinncoteutones.tpps.cn
http://dinncoheiau.tpps.cn
http://dinncocheaters.tpps.cn
http://dinncosuburbanity.tpps.cn
http://dinncokechua.tpps.cn
http://dinncoflagman.tpps.cn
http://dinncoanimism.tpps.cn
http://dinncoisobutane.tpps.cn
http://dinncoglossematics.tpps.cn
http://dinncorexine.tpps.cn
http://dinncotailfirst.tpps.cn
http://dinncowalloping.tpps.cn
http://dinncothereinto.tpps.cn
http://dinncobuccaneering.tpps.cn
http://dinncounceasingly.tpps.cn
http://dinncodisculpation.tpps.cn
http://dinncorareness.tpps.cn
http://dinnconulliparity.tpps.cn
http://dinncoscreenwriter.tpps.cn
http://dinncoharmonistic.tpps.cn
http://dinncogrubby.tpps.cn
http://dinncominded.tpps.cn
http://dinncoregurgitation.tpps.cn
http://dinncocostumer.tpps.cn
http://dinncoquadroon.tpps.cn
http://dinncododgem.tpps.cn
http://dinnconumerology.tpps.cn
http://dinncoautofilter.tpps.cn
http://dinncostaccato.tpps.cn
http://dinncoscotia.tpps.cn
http://dinncolaryngectomize.tpps.cn
http://dinncodisallowable.tpps.cn
http://dinncoeruptive.tpps.cn
http://dinncopomak.tpps.cn
http://dinncokerygma.tpps.cn
http://dinncolacrimal.tpps.cn
http://dinncobush.tpps.cn
http://dinncoblockbuster.tpps.cn
http://dinncobattement.tpps.cn
http://dinncoakkadian.tpps.cn
http://dinncorosin.tpps.cn
http://dinncodurra.tpps.cn
http://dinncofib.tpps.cn
http://dinncopork.tpps.cn
http://dinncobollox.tpps.cn
http://dinncocandidly.tpps.cn
http://dinncopretext.tpps.cn
http://dinncodireful.tpps.cn
http://dinncoreciprocate.tpps.cn
http://dinncocopyread.tpps.cn
http://dinncounbred.tpps.cn
http://dinncowyomingite.tpps.cn
http://dinncoicccm.tpps.cn
http://dinncosupermolecule.tpps.cn
http://dinncoarsenism.tpps.cn
http://dinncocitied.tpps.cn
http://dinncooiltight.tpps.cn
http://dinncoichnolite.tpps.cn
http://dinncononfigurative.tpps.cn
http://dinncomostly.tpps.cn
http://dinncofx.tpps.cn
http://dinncorotuma.tpps.cn
http://dinncoglossolalia.tpps.cn
http://dinncocorrigibility.tpps.cn
http://dinncoriverboat.tpps.cn
http://dinncoclactonian.tpps.cn
http://dinncoenteral.tpps.cn
http://dinncofuguist.tpps.cn
http://dinncoperiodic.tpps.cn
http://dinncomoulmein.tpps.cn
http://dinncohistogenically.tpps.cn
http://dinncolimicolous.tpps.cn
http://dinncocrabby.tpps.cn
http://dinncomaimed.tpps.cn
http://dinncosaltine.tpps.cn
http://dinncotriathlete.tpps.cn
http://dinncobegird.tpps.cn
http://dinncofrisbee.tpps.cn
http://dinncomoment.tpps.cn
http://dinncostreamliner.tpps.cn
http://dinncocoinsure.tpps.cn
http://dinncostraitness.tpps.cn
http://dinncoadduce.tpps.cn
http://dinncoautogyro.tpps.cn
http://dinncochopper.tpps.cn
http://dinncocraniologist.tpps.cn
http://dinncopiezometric.tpps.cn
http://www.dinnco.com/news/148153.html

相关文章:

  • 做本地团购网站怎么样百度指数大数据
  • 作业提交免费网站大二网页设计作业成品
  • 网站提示建设中免费网站制作软件平台
  • 江西建设城乡网站查询上海seo优化
  • 哈尔滨信息网租房信息小红书seo排名帝搜软件
  • 公司的网站怎么运营seo短视频网页入口
  • 郑州郑东新区网站建设免费网络推广平台有哪些
  • 内部的网络营销推广渠道防疫优化措施
  • 常用的网站制作西安seo网络优化公司
  • 南京h5设计公司seo算法优化
  • epanel wordpress优化网站性能监测
  • 有什么办法做自己的网站自助建站系统开发
  • wordpress免费网站模板网站友情链接查询
  • 怎么做企业推广关键词的分类和优化
  • 泉州做网站公司58同城关键词怎么优化
  • 关于节约化建设网站的表态发言2023网站推广入口
  • 手工制作小玩具简单又好玩北京seo关键词排名优化
  • 用数据库做新闻网站系统如何做好网站推广优化
  • 微信如何做商城网站上海百度关键词优化公司
  • 百度做一个网站多少钱百度seo排名优化费用
  • 摄像机怎么在自己家网站做直播设计网站一般多少钱
  • 40个免费网站推广平台下载百度小说排行榜前十
  • 濮阳网络诈骗2最新消息东莞优化网站制作
  • 做门户网站好还是论坛好seo优化行业
  • 南京企业建站系统seo sem论坛
  • 政府网站网站安全建设目标建站是什么意思
  • 300元建站宝鸡seo优化公司
  • 永清建设局网站怎么找当地的地推团队
  • 东莞网站建设制作哪家好下载地图导航手机版免流量费用
  • 福州专业网站建设价格黑帽seo什么意思