minor changes to improve performance

git-svn-id: https://svn.cs.york.ac.uk/svn/ossmeter/Software/source@906 1b171192-1bc4-4300-84b6-1b6fde2e8ce3

ioannis.korkontzelos@manchester.ac.uk ioannis.korkontzelos@manchester.ac.uk 2014-02-22

added metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ThreadData.java
changed metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleData.java
changed metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleDataComparator.java
changed metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/Threads.java
changed metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/threads.ecore
changed metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/threads.emf
changed metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/ThreadsMetricProvider.java
copied metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleDataCollection.java -> metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ThreadDataCollection.java
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ThreadData.java Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleData.java Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleDataComparator.java Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/Threads.java Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/threads.ecore Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/threads.emf Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/ThreadsMetricProvider.java Diff Switch to side-by-side view
Loading...
metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleDataCollection.java to metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ThreadDataCollection.java
--- a/metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ArticleDataCollection.java
+++ b/metric-providers/org.ossmeter.metricprovider.threads/src/org/ossmeter/metricprovider/threads/model/ThreadDataCollection.java
@@ -4,62 +4,45 @@
 import java.util.*;
 import com.mongodb.*;
 
-public class ArticleDataCollection extends PongoCollection<ArticleData> {
+public class ThreadDataCollection extends PongoCollection<ThreadData> {
 	
-	public ArticleDataCollection(DBCollection dbCollection) {
+	public ThreadDataCollection(DBCollection dbCollection) {
 		super(dbCollection);
-		createIndex("url_name");
-		createIndex("articleNumber");
+		createIndex("threadId");
 	}
 	
-	public Iterable<ArticleData> findById(String id) {
-		return new IteratorIterable<ArticleData>(new PongoCursorIterator<ArticleData>(this, dbCollection.find(new BasicDBObject("_id", id))));
+	public Iterable<ThreadData> findById(String id) {
+		return new IteratorIterable<ThreadData>(new PongoCursorIterator<ThreadData>(this, dbCollection.find(new BasicDBObject("_id", id))));
 	}
 	
-	public Iterable<ArticleData> findByUrl_name(String q) {
-		return new IteratorIterable<ArticleData>(new PongoCursorIterator<ArticleData>(this, dbCollection.find(new BasicDBObject("url_name", q + ""))));
+	public Iterable<ThreadData> findByThreadId(int q) {
+		return new IteratorIterable<ThreadData>(new PongoCursorIterator<ThreadData>(this, dbCollection.find(new BasicDBObject("threadId", q + ""))));
 	}
 	
-	public ArticleData findOneByUrl_name(String q) {
-		ArticleData articleData = (ArticleData) PongoFactory.getInstance().createPongo(dbCollection.findOne(new BasicDBObject("url_name", q + "")));
-		if (articleData != null) {
-			articleData.setPongoCollection(this);
+	public ThreadData findOneByThreadId(int q) {
+		ThreadData threadData = (ThreadData) PongoFactory.getInstance().createPongo(dbCollection.findOne(new BasicDBObject("threadId", q + "")));
+		if (threadData != null) {
+			threadData.setPongoCollection(this);
 		}
-		return articleData;
+		return threadData;
 	}
 	
 
-	public long countByUrl_name(String q) {
-		return dbCollection.count(new BasicDBObject("url_name", q + ""));
-	}
-	public Iterable<ArticleData> findByArticleNumber(int q) {
-		return new IteratorIterable<ArticleData>(new PongoCursorIterator<ArticleData>(this, dbCollection.find(new BasicDBObject("articleNumber", q + ""))));
-	}
-	
-	public ArticleData findOneByArticleNumber(int q) {
-		ArticleData articleData = (ArticleData) PongoFactory.getInstance().createPongo(dbCollection.findOne(new BasicDBObject("articleNumber", q + "")));
-		if (articleData != null) {
-			articleData.setPongoCollection(this);
-		}
-		return articleData;
-	}
-	
-
-	public long countByArticleNumber(int q) {
-		return dbCollection.count(new BasicDBObject("articleNumber", q + ""));
+	public long countByThreadId(int q) {
+		return dbCollection.count(new BasicDBObject("threadId", q + ""));
 	}
 	
 	@Override
-	public Iterator<ArticleData> iterator() {
-		return new PongoCursorIterator<ArticleData>(this, dbCollection.find());
+	public Iterator<ThreadData> iterator() {
+		return new PongoCursorIterator<ThreadData>(this, dbCollection.find());
 	}
 	
-	public void add(ArticleData articleData) {
-		super.add(articleData);
+	public void add(ThreadData threadData) {
+		super.add(threadData);
 	}
 	
-	public void remove(ArticleData articleData) {
-		super.remove(articleData);
+	public void remove(ThreadData threadData) {
+		super.remove(threadData);
 	}
 	
 }