java.util.AbstractMap.isEmpty()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(143)

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

AbstractMap.isEmpty介绍

[英]This implementation compares size() to 0.
[中]此实现将size()与0进行比较。

代码示例

代码示例来源:origin: robovm/robovm

if (isEmpty()) {
  return "{}";

代码示例来源:origin: geotools/geotools

/**
 * Returns {@code true} if this map contains no key-value mappings.
 *
 * @return {@code true} if this map contains no key-value mappings.
 */
@Override
public boolean isEmpty() {
  return base.isEmpty() || super.isEmpty();
}

代码示例来源:origin: com.sun.xml.ws/rt

@Override
public boolean isEmpty() {
  // TODO Auto-generated method stub
  return super.isEmpty();
}

代码示例来源:origin: com.sun.xml.ws/jaxws-rt

@Override
public boolean isEmpty() {
  // TODO Auto-generated method stub
  return super.isEmpty();
}

代码示例来源:origin: javaee/metro-jax-ws

@Override
public boolean isEmpty() {
  // TODO Auto-generated method stub
  return super.isEmpty();
}

代码示例来源:origin: dragome/dragome-sdk

public boolean isEmpty() {
  return AbstractMap.this.isEmpty();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

public boolean isEmpty() {
  return AbstractMap.this.isEmpty();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

public boolean isEmpty() {
  return AbstractMap.this.isEmpty();
}

代码示例来源:origin: jtulach/bck2brwsr

public boolean isEmpty() {
  return AbstractMap.this.isEmpty();
}

代码示例来源:origin: dragome/dragome-sdk

public boolean isEmpty() {
  return AbstractMap.this.isEmpty();
}

代码示例来源:origin: jtulach/bck2brwsr

public boolean isEmpty() {
  return AbstractMap.this.isEmpty();
}

代码示例来源:origin: org.geotools/gt-metadata

/**
 * Returns {@code true} if this map contains no key-value mappings.
 *
 * @return {@code true} if this map contains no key-value mappings.
 */
@Override
public boolean isEmpty() {
return base.isEmpty() || super.isEmpty();
}

代码示例来源:origin: org.geotools/gt2-metadata

/**
 * Returns {@code true} if this map contains no key-value mappings.
 *
 * @return {@code true} if this map contains no key-value mappings.
 */
public boolean isEmpty() {
return base.isEmpty() || super.isEmpty();
}

代码示例来源:origin: teatrove/teatrove

public boolean isEmpty() {
  if (mPrefix == null) {
    return mMappings.isEmpty();
  }
  else {
    return super.isEmpty();
  }
}

代码示例来源:origin: stackoverflow.com

public static boolean haveCommonKeys(TreeMap<String,?> map1, TreeMap<String,?> map2) {
  if(map1.isEmpty()) return false;
  for(String s=map1.firstKey(); s!=null; ) {
    String s2=map2.ceilingKey(s);
    if(s2==null) break;
    if(s2.equals(s)) return true;
    s=map1.ceilingKey(s2);
    if(s2.equals(s)) return true;
  }
  return false;
}

代码示例来源:origin: undera/jmeter-plugins

private boolean drawMessages(Graphics2D g) {
  if (errorMessage != null) {
    g.setColor(Color.RED);
    g.drawString(errorMessage, g.getClipBounds().width / 2 - g.getFontMetrics(g.getFont()).stringWidth(errorMessage) / 2, g.getClipBounds().height / 2);
    return true;
  }
  if (rows.isEmpty()) {
    g.setColor(Color.BLACK);
    g.drawString(NO_SAMPLES, g.getClipBounds().width / 2 - g.getFontMetrics(g.getFont()).stringWidth(NO_SAMPLES) / 2, g.getClipBounds().height / 2);
    return true;
  }
  return false;
}

代码示例来源:origin: kg.apc/jmeter-plugins-cmn-jmeter

private boolean drawMessages(Graphics2D g) {
  if (errorMessage != null) {
    g.setColor(Color.RED);
    g.drawString(errorMessage, g.getClipBounds().width / 2 - g.getFontMetrics(g.getFont()).stringWidth(errorMessage) / 2, g.getClipBounds().height / 2);
    return true;
  }
  if (rows.isEmpty()) {
    g.setColor(Color.BLACK);
    g.drawString(NO_SAMPLES, g.getClipBounds().width / 2 - g.getFontMetrics(g.getFont()).stringWidth(NO_SAMPLES) / 2, g.getClipBounds().height / 2);
    return true;
  }
  return false;
}

代码示例来源:origin: stackoverflow.com

public void mergeSort(File[] inFiles, File outFile, Comparator<String> comparator) throws IOException  {
  try {
    BufferedReader[] readers = new BufferedReader[inFiles.length];
    PrintWriter writer = new PrintWriter(outFile);
    TreeMap<String, Integer> treeMap = new TreeMap<String, Integer>(
       comparator);
    // read first line of each file. We don't check for EOF here, probably should
    for (int i = 0; i < inFiles.length; i++) {
     readers[i] = new BufferedReader(new FileReader(inFiles[i]));
     String line = readers[i].readLine();
     treeMap.put(line, Integer.valueOf(i));
    }
    while (!treeMap.isEmpty()) {
     Map.Entry<String, Integer> nextToGo = treeMap.pollFirstEntry();
     int fileIndex = nextToGo.getValue().intValue();
     writer.println(nextToGo.getKey());
     String line = readers[fileIndex].readLine();
     if (line != null)
       treeMap.put(line, Integer.valueOf(fileIndex));
    }
  }
  finally {
    // close everything here...
  }
 }

代码示例来源:origin: ibinti/bugvm

if (isEmpty()) {
  return "{}";

代码示例来源:origin: stackoverflow.com

if (map == null || map.isEmpty())
  return;
for (Object m : map.entrySet()) {

相关文章