First attempt for matching multi topic selector
This commit is contained in:
+17
-4
@@ -78,6 +78,10 @@ public class SubscriptionsStore {
|
|||||||
|
|
||||||
//check the matching of the current token
|
//check the matching of the current token
|
||||||
//TODO take care of MULTI and SINGLE
|
//TODO take care of MULTI and SINGLE
|
||||||
|
// if (m_token == Token.MULTI) {
|
||||||
|
// matchingSubs.addAll(m_subscriptions);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
List<TreeNode> matchingChildren = new ArrayList<TreeNode>();
|
List<TreeNode> matchingChildren = new ArrayList<TreeNode>();
|
||||||
for (TreeNode child : m_children) {
|
for (TreeNode child : m_children) {
|
||||||
@@ -86,12 +90,16 @@ public class SubscriptionsStore {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchingChildren.isEmpty()) {
|
// if (matchingChildren.isEmpty()) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (TreeNode child : matchingChildren) {
|
for (TreeNode child : matchingChildren) {
|
||||||
child.matches(tokens, matchingSubs);
|
if (child.getToken() == Token.MULTI) {
|
||||||
|
matchingSubs.addAll(m_subscriptions);
|
||||||
|
} else {
|
||||||
|
child.matches(tokens, matchingSubs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,6 +173,11 @@ public class SubscriptionsStore {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// private List<Subscription> subscriptions = new ArrayList<Subscription>();
|
// private List<Subscription> subscriptions = new ArrayList<Subscription>();
|
||||||
|
|||||||
Reference in New Issue
Block a user