You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by si...@apache.org on 2010/01/14 04:44:53 UTC

svn commit: r899050 - in /labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website: CompoundableProducer.java CompoundableProducerImpl.aj

Author: simoneg
Date: Thu Jan 14 03:44:53 2010
New Revision: 899050

URL: http://svn.apache.org/viewvc?rev=899050&view=rev
Log:
Ability to remove compounded producers

Modified:
    labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducer.java
    labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducer.java?rev=899050&r1=899049&r2=899050&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducer.java (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducer.java Thu Jan 14 03:44:53 2010
@@ -24,6 +24,8 @@
 	public CompoundableProducer compoundCssClass(String cssClass, CompoundType type);
 	public List<Producer> findCompoundedOn(CompoundType type);
 	public List<Producer> findRecursivelyCompoundedOn(CompoundType type);
+	public void removeCompundedOn(CompoundType type);
+	public void removeCompounded(Producer producer);
 	public void markDone(Producer other);
 	public void clearDone();
 	

Modified: labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj?rev=899050&r1=899049&r2=899050&view=diff
==============================================================================
--- labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj (original)
+++ labs/magma/trunk/foundation-website/src/main/java/org/apache/magma/website/CompoundableProducerImpl.aj Thu Jan 14 03:44:53 2010
@@ -21,6 +21,7 @@
 import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
@@ -66,6 +67,25 @@
 		return this;
 	}
 
+	public void CompoundableProducer.removeCompundedOn(CompoundType type) {
+		if (compound == null) return;
+		Iterator<CompoundRelation> iter = compound.iterator();
+		while (iter.hasNext()) {
+			CompoundRelation rel = iter.next();
+			if (rel.type == type) iter.remove();
+		}
+	}
+	
+	public void CompoundableProducer.removeCompounded(Producer producer) {
+		if (compound == null) return;
+		Iterator<CompoundRelation> iter = compound.iterator();
+		while (iter.hasNext()) {
+			CompoundRelation rel = iter.next();
+			if (rel.prod == producer) iter.remove();
+		}
+	}
+	
+	
 	public void CompoundableProducer.markDone(Producer p) {
 		if (compound == null) return;
 		for (CompoundRelation rel : this.compound) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org