本文整理汇总了Java中org.javarosa.core.model.instance.utils.ITreeVisitor类的典型用法代码示例。如果您正苦于以下问题:Java ITreeVisitor类的具体用法?Java ITreeVisitor怎么用?Java ITreeVisitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ITreeVisitor类属于org.javarosa.core.model.instance.utils包,在下文中一共展示了ITreeVisitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAcceptsVisitor
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void testAcceptsVisitor() {
final MutableBoolean visitorAccepted = new MutableBoolean(false);
final MutableBoolean dispatchedWrong = new MutableBoolean(false);
ITreeVisitor sampleVisitor = new ITreeVisitor() {
public void visit(FormInstance tree) {
dispatchedWrong.bool = true;
}
public void visit(AbstractTreeElement element) {
visitorAccepted.bool = true;
}
};
stringElement.accept(sampleVisitor);
assertTrue("The visitor's visit method was not called correctly by the QuestionDataElement",visitorAccepted.getValue());
assertTrue("The visitor was dispatched incorrectly by the QuestionDataElement",!dispatchedWrong.getValue());
}
示例2: testAcceptsVisitor
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void testAcceptsVisitor() {
final MutableBoolean visitorAccepted = new MutableBoolean(false);
final MutableBoolean dispatchedWrong = new MutableBoolean(false);
ITreeVisitor sampleVisitor = new ITreeVisitor() {
public void visit(FormInstance tree) {
dispatchedWrong.setValue(true);
}
public void visit(AbstractTreeElement element) {
visitorAccepted.setValue(true);
}
};
stringElement.accept(sampleVisitor);
assertTrue("The visitor's visit method was not called correctly by the QuestionDataElement",visitorAccepted.getValue());
assertTrue("The visitor was dispatched incorrectly by the QuestionDataElement",!dispatchedWrong.getValue());
}
示例3: testAcceptsVisitor
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Test
public void testAcceptsVisitor() {
final MutableBoolean visitorAccepted = new MutableBoolean(false);
final MutableBoolean dispatchedWrong = new MutableBoolean(false);
ITreeVisitor sampleVisitor = new ITreeVisitor() {
public void visit(FormInstance tree) {
dispatchedWrong.bool = true;
}
public void visit(AbstractTreeElement element) {
visitorAccepted.bool = true;
}
};
stringElement.accept(sampleVisitor);
assertTrue("The visitor's visit method was not called correctly by the QuestionDataElement", visitorAccepted.getValue());
assertTrue("The visitor was dispatched incorrectly by the QuestionDataElement", !dispatchedWrong.getValue());
}
示例4: testAcceptsVisitor
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Test
public void testAcceptsVisitor() {
final MutableBoolean visitorAccepted = new MutableBoolean(false);
final MutableBoolean dispatchedWrong = new MutableBoolean(false);
ITreeVisitor sampleVisitor = new ITreeVisitor() {
public void visit(FormInstance tree) {
dispatchedWrong.setValue(true);
}
public void visit(AbstractTreeElement element) {
visitorAccepted.setValue(true);
}
};
stringElement.accept(sampleVisitor);
assertTrue("The visitor's visit method was not called correctly by the QuestionDataElement", visitorAccepted.getValue());
assertTrue("The visitor was dispatched incorrectly by the QuestionDataElement", !dispatchedWrong.getValue());
}
示例5: testAcceptsVisitor
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Test
public void testAcceptsVisitor() {
final MutableBoolean visitorAccepted = new MutableBoolean(false);
final MutableBoolean dispatchedWrong = new MutableBoolean(false);
ITreeVisitor sampleVisitor = new ITreeVisitor() {
@Override
public void visit(FormInstance tree) {
dispatchedWrong.bool = true;
}
@Override
public void visit(AbstractTreeElement element) {
visitorAccepted.bool = true;
}
};
stringElement.accept(sampleVisitor);
assertTrue("The visitor's visit method was not called correctly by the QuestionDataElement", visitorAccepted.getValue());
assertTrue("The visitor was dispatched incorrectly by the QuestionDataElement", !dispatchedWrong.getValue());
}
示例6: testAcceptsVisitor
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Test
public void testAcceptsVisitor() {
final MutableBoolean visitorAccepted = new MutableBoolean(false);
final MutableBoolean dispatchedWrong = new MutableBoolean(false);
ITreeVisitor sampleVisitor = new ITreeVisitor() {
@Override
public void visit(FormInstance tree) {
dispatchedWrong.setValue(true);
}
@Override
public void visit(AbstractTreeElement element) {
visitorAccepted.setValue(true);
}
};
stringElement.accept(sampleVisitor);
assertTrue("The visitor's visit method was not called correctly by the QuestionDataElement", visitorAccepted.getValue());
assertTrue("The visitor was dispatched incorrectly by the QuestionDataElement", !dispatchedWrong.getValue());
}
示例7: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(ITreeVisitor visitor) {
visitor.visit(this);
if(children == null) { return;}
for (TreeElement child : children) {
child.accept(visitor);
}
}
示例8: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(IInstanceVisitor visitor) {
visitor.visit(this);
if (visitor instanceof ITreeVisitor) {
root.accept((ITreeVisitor) visitor);
}
}
示例9: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Override
public void accept(ITreeVisitor visitor) {
visitor.visit(this);
if (children == null) {
return;
}
Enumeration en = children.elements();
while (en.hasMoreElements()) {
((TreeElement)en.nextElement()).accept(visitor);
}
}
示例10: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(IInstanceVisitor visitor) {
visitor.visit(this);
if (visitor instanceof ITreeVisitor) {
root.accept((ITreeVisitor)visitor);
}
}
示例11: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(ITreeVisitor visitor) {
visitor.visit(this);
if (children == null) {
return;
}
Enumeration en = children.elements();
while (en.hasMoreElements()) {
((ConcreteTreeElement)en.nextElement()).accept(visitor);
}
}
示例12: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Override
public void accept(ITreeVisitor visitor) {
visitor.visit(this);
if (children == null) {
return;
}
Enumeration en = children.elements();
while (en.hasMoreElements()) {
((ConcreteTreeElement)en.nextElement()).accept(visitor);
}
}
示例13: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(ITreeVisitor visitor) {
child.accept(visitor);
}
示例14: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Override
public void accept(ITreeVisitor visitor) {
visitor.visit(this);
}
示例15: accept
import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(ITreeVisitor visitor) {
visitor.visit(this);
}