当前位置: 首页>>代码示例>>Java>>正文


Java ITreeVisitor类代码示例

本文整理汇总了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());
}
 
开发者ID:medic,项目名称:javarosa,代码行数:19,代码来源:QuestionDataElementTests.java

示例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());
}
 
开发者ID:medic,项目名称:javarosa,代码行数:20,代码来源:QuestionDataGroupTests.java

示例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());
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:21,代码来源:QuestionDataElementTests.java

示例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());
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:22,代码来源:QuestionDataGroupTests.java

示例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());
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:23,代码来源:QuestionDataElementTests.java

示例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());
}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:24,代码来源:QuestionDataGroupTests.java

示例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);
     }
}
 
开发者ID:medic,项目名称:javarosa,代码行数:9,代码来源:TreeElement.java

示例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);
	}

}
 
开发者ID:medic,项目名称:javarosa,代码行数:9,代码来源:FormInstance.java

示例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);
    }

}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:14,代码来源:TreeElement.java

示例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);
    }
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:8,代码来源:FormInstance.java

示例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);
    }

}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:13,代码来源:ConcreteTreeElement.java

示例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);
    }

}
 
开发者ID:dimagi,项目名称:commcare-core,代码行数:14,代码来源:ConcreteTreeElement.java

示例13: accept

import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(ITreeVisitor visitor) {
    child.accept(visitor);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:4,代码来源:InstanceBase.java

示例14: accept

import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
@Override
public void accept(ITreeVisitor visitor) {
    visitor.visit(this);

}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:6,代码来源:LedgerInstanceTreeElement.java

示例15: accept

import org.javarosa.core.model.instance.utils.ITreeVisitor; //导入依赖的package包/类
public void accept(ITreeVisitor visitor) {
    visitor.visit(this);
}
 
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:4,代码来源:LedgerChildElement.java


注:本文中的org.javarosa.core.model.instance.utils.ITreeVisitor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。