edu.emory.mathcs.backport.java.util.Arrays.sort()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中edu.emory.mathcs.backport.java.util.Arrays.sort()方法的一些代码示例,展示了Arrays.sort()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Arrays.sort()方法的具体详情如下:
包路径:edu.emory.mathcs.backport.java.util.Arrays
类名称:Arrays
方法名:sort

Arrays.sort介绍

暂无

代码示例

代码示例来源:origin: reficio/p2-maven-plugin

/**
 * Adjust the pluginId TODO - this may be wrong if singleton is used
 */
public static void adjustFeaturePluginData(Document featureSpec, File pluginDir, Log log) throws IOException {
    //get list of all plugins
    NodeList plugins = featureSpec.getElementsByTagName("plugin");
    for(int i=0; i<plugins.getLength(); ++i) {
      Node n = plugins.item(i);
      if (n instanceof Element) {
        Element el = (Element)n;
        String pluginId = el.getAttribute("id");
        File[] files = findFiles(pluginDir, pluginId);
        if (files.length == 0) {
          log.error("Cannot find plugin "+pluginId);
        } else {
          //in case more than one plugin with same id
          Arrays.sort(files,fileComparator);
          //File firstFile = files[0];
          File lastFile = files[files.length-1];
          //String firstVersion = BundleUtils.INSTANCE.getBundleVersion(new Jar(firstFile));
          String lastVersion = BundleUtils.INSTANCE.getBundleVersion(new Jar(lastFile)); //may throw IOException
          log.info("Adjusting version for plugin "+pluginId+" to "+lastVersion);
          el.setAttribute("version", lastVersion);
        }
      }
    }
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouper-ws

/** 
 * convert pit attribute assign values
 * @param attributeAssignValueSet should be the value row
 * @return the results
 */
public static WsAttributeAssignValue[] convertPITAttributeAssignValues(Set<PITAttributeAssignValue> attributeAssignValueSet) {
 int attributeAssignSetLength = GrouperUtil.length(attributeAssignValueSet);
 if (attributeAssignSetLength == 0) {
  return null;
 }

 WsAttributeAssignValue[] wsAttributeAssignValueResultArray = new WsAttributeAssignValue[attributeAssignSetLength];
 int index = 0;
 for (PITAttributeAssignValue attributeAssignValue : attributeAssignValueSet) {
  wsAttributeAssignValueResultArray[index++] = new WsAttributeAssignValue(attributeAssignValue);      
 }
 
 Arrays.sort(wsAttributeAssignValueResultArray);
 
 return wsAttributeAssignValueResultArray;
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouper-ws

/** 
 * convert attribute assigns
 * @param attributeAssignValueSet should be the value row
 * @return the subject results
 */
public static WsAttributeAssignValue[] convertAttributeAssigns(Set<AttributeAssignValue> attributeAssignValueSet) {
 int attributeAssignSetLength = GrouperUtil.length(attributeAssignValueSet);
 if (attributeAssignSetLength == 0) {
  return null;
 }

 WsAttributeAssignValue[] wsAttributeAssignValueResultArray = new WsAttributeAssignValue[attributeAssignSetLength];
 int index = 0;
 for (AttributeAssignValue attributeAssignValue : attributeAssignValueSet) {
     
  wsAttributeAssignValueResultArray[index++] = new WsAttributeAssignValue(attributeAssignValue);
  
 }
 
 Arrays.sort(wsAttributeAssignValueResultArray);
 
 return wsAttributeAssignValueResultArray;
}

代码示例来源:origin: edu.internet2.middleware.grouper/grouper-ws

i++;
Arrays.sort(wsAttributeAssignValueResultArray);
wsAssignAttributeResult.setWsAttributeAssignValueResults(wsAttributeAssignValueResultArray);

相关文章