]> source.dussan.org Git - poi.git/commitdiff
add isEmpty() method
authorPJ Fanning <fanningpj@apache.org>
Thu, 30 Dec 2021 01:25:20 +0000 (01:25 +0000)
committerPJ Fanning <fanningpj@apache.org>
Thu, 30 Dec 2021 01:25:20 +0000 (01:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1896521 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/openxml4j/opc/PackageRelationshipCollection.java

index b529a493a12a765252c1caab50dd13acba9da770..bece2c742ec616b48439284949365d1b7c603800 100644 (file)
@@ -281,10 +281,18 @@ public final class PackageRelationshipCollection implements Iterable<PackageRela
     }
 
     /**
-     * Get the numbe rof relationships in the collection.
+     * Get the numbeof relationships in the collection.
      */
     public int size() {
-        return relationshipsByID.values().size();
+        return relationshipsByID.size();
+    }
+
+    /**
+     * Is this collection empty?
+     * @since POI 5.2.0
+     */
+    public boolean isEmpty() {
+        return relationshipsByID.isEmpty();
     }
 
     /**