jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/2] jena git commit: Element::getLast
Date Tue, 14 Jul 2015 16:21:49 GMT
Repository: jena
Updated Branches:
  refs/heads/master 523261319 -> a31c7d271


Element::getLast

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/b43a3f25
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/b43a3f25
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/b43a3f25

Branch: refs/heads/master
Commit: b43a3f25c40144f002c17d51eba1313b9e0ed4fd
Parents: 5232613
Author: Andy Seaborne <andy@apache.org>
Authored: Tue Jul 14 17:20:20 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Tue Jul 14 17:20:20 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/jena/sparql/syntax/ElementGroup.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/b43a3f25/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementGroup.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementGroup.java b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementGroup.java
index 9ec1535..e556774 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementGroup.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/syntax/ElementGroup.java
@@ -82,6 +82,11 @@ public class ElementGroup extends Element
     public boolean isEmpty()            { return elements.size() == 0 ; }
     public int size()                   { return elements.size() ; }
     public Element get(int idx)         { return elements.get(idx) ; }
+    public Element getLast() { 
+        if ( elements.isEmpty() )
+            return null ;
+        return elements.get(elements.size()-1) ;
+    }
 
     @Override
     public int hashCode()


Mime
View raw message