Skip to content
Browse files

Parameterized Long, String and Integer map jid factories

  • Loading branch information...
1 parent bc57217 commit 9ee47e68226c5ea2e208fc4a6161e9e2470c7941 @laforge49 committed Apr 22, 2012
View
2 src/main/java/org/agilewiki/jid/collection/vlenc/map/IntegerMapJid.java
@@ -29,7 +29,7 @@
/**
* Holds a map with Integer keys.
*/
-abstract public class IntegerMapJid extends MapJid<Integer> {
+public class IntegerMapJid extends MapJid<Integer> {
/**
* Create a KMake request.
*
View
35 src/main/java/org/agilewiki/jid/collection/vlenc/map/IntegerMapJidFactory.java
@@ -0,0 +1,35 @@
+package org.agilewiki.jid.collection.vlenc.map;
+
+import org.agilewiki.jactor.Mailbox;
+import org.agilewiki.jactor.factory.ActorFactory;
+
+/**
+ * Creates IntegerMapJid's.
+ */
+public class IntegerMapJidFactory extends ActorFactory {
+ private ActorFactory valueFactory;
+
+ /**
+ * Create an ActorFactory.
+ *
+ * @param actorType The actor type.
+ */
+ public IntegerMapJidFactory(String actorType, ActorFactory valueFactory) {
+ super(actorType);
+ this.valueFactory = valueFactory;
+ }
+
+ /**
+ * Create a JLPCActor.
+ *
+ * @param mailbox The mailbox of the new actor.
+ * @return The new actor.
+ */
+ @Override
+ protected IntegerMapJid instantiateActor(Mailbox mailbox)
+ throws Exception {
+ IntegerMapJid imj = new IntegerMapJid(mailbox);
+ imj.valueFactory = valueFactory;
+ return imj;
+ }
+}
View
2 src/main/java/org/agilewiki/jid/collection/vlenc/map/LongMapJid.java
@@ -29,7 +29,7 @@
/**
* Holds a map with Long keys.
*/
-abstract public class LongMapJid extends MapJid<Long> {
+public class LongMapJid extends MapJid<Long> {
/**
* Create a KMake request.
*
View
35 src/main/java/org/agilewiki/jid/collection/vlenc/map/LongMapJidFactory.java
@@ -0,0 +1,35 @@
+package org.agilewiki.jid.collection.vlenc.map;
+
+import org.agilewiki.jactor.Mailbox;
+import org.agilewiki.jactor.factory.ActorFactory;
+
+/**
+ * Creates LongMapJid's.
+ */
+public class LongMapJidFactory extends ActorFactory {
+ private ActorFactory valueFactory;
+
+ /**
+ * Create an ActorFactory.
+ *
+ * @param actorType The actor type.
+ */
+ public LongMapJidFactory(String actorType, ActorFactory valueFactory) {
+ super(actorType);
+ this.valueFactory = valueFactory;
+ }
+
+ /**
+ * Create a JLPCActor.
+ *
+ * @param mailbox The mailbox of the new actor.
+ * @return The new actor.
+ */
+ @Override
+ protected LongMapJid instantiateActor(Mailbox mailbox)
+ throws Exception {
+ LongMapJid imj = new LongMapJid(mailbox);
+ imj.valueFactory = valueFactory;
+ return imj;
+ }
+}
View
2 src/main/java/org/agilewiki/jid/collection/vlenc/map/StringMapJid.java
@@ -29,7 +29,7 @@
/**
* Holds a map with String keys.
*/
-abstract public class StringMapJid extends MapJid<String> {
+public class StringMapJid extends MapJid<String> {
/**
* Create a KMake request.
*
View
35 src/main/java/org/agilewiki/jid/collection/vlenc/map/StringMapJidFactory.java
@@ -0,0 +1,35 @@
+package org.agilewiki.jid.collection.vlenc.map;
+
+import org.agilewiki.jactor.Mailbox;
+import org.agilewiki.jactor.factory.ActorFactory;
+
+/**
+ * Creates StringMapJid's.
+ */
+public class StringMapJidFactory extends ActorFactory {
+ private ActorFactory valueFactory;
+
+ /**
+ * Create an ActorFactory.
+ *
+ * @param actorType The actor type.
+ */
+ public StringMapJidFactory(String actorType, ActorFactory valueFactory) {
+ super(actorType);
+ this.valueFactory = valueFactory;
+ }
+
+ /**
+ * Create a JLPCActor.
+ *
+ * @param mailbox The mailbox of the new actor.
+ * @return The new actor.
+ */
+ @Override
+ protected StringMapJid instantiateActor(Mailbox mailbox)
+ throws Exception {
+ StringMapJid imj = new StringMapJid(mailbox);
+ imj.valueFactory = valueFactory;
+ return imj;
+ }
+}

0 comments on commit 9ee47e6

Please sign in to comment.
Something went wrong with that request. Please try again.