【问题标题】:How to read Default.rule in java?如何在 java 中读取 Default.rule?
【发布时间】:2013-09-20 12:43:52
【问题描述】:

我有一个java项目,取自站点

UBI REAL PROJECT

在这个项目中,我找到了一个名为 Default.rule 的文件。我不知道 java 文件是如何扩展的。

我找不到这个类在项目中的调用位置(在我将 .class 提取到 .java 之后)。

所以,如果我看到这个文件,它在 TextEditor 中看起来像这样

exLiving="Living Existence Sensor";
dvLight="Light";
LivingLamp1="LivingLamp1";
LivingLamp2="LivingLamp2";
LivingLamp3="LivingLamp3";
LivFan="LivingFan";
clock="Example";
curtain="Curtain";
camera="SurveillanceCamera";
component="MusicPlayer";
fan="Fan";

ruleset(0) {
    if( !exLiving.mah && !exLiving.Alice ){
        dvLight.SetPower(0.0);
        LivingLamp1.SetPower(1.0);
        LivingLamp2.SetPower(1.0);
        LivingLamp3.SetPower(1.0);
        LivFan.SetPower(0.0);
        clock.SetStatus(true);
        curtain.SetStatus(false);

        camera.SetPower(false);

        component.SetPower(false);

        fan.setPower(false);
    }   


if( exLiving.mah && exLiving.Alice ){
        dvLight.SetPower(1.0);
        LivingLamp1.SetPower(0.0);
        LivingLamp2.SetPower(1.0);
        LivingLamp3.SetPower(0.0);
        LivFan.SetPower(0.0);
        clock.SetStatus(true);
        curtain.SetStatus(true);

        camera.SetPower(false);

        component.SetPower(true);

        fan.setPower(true);



}
    if( exLiving.mah && !exLiving.Alice ){
        dvLight.SetPower(0.0);
        LivingLamp1.SetPower(1.0);
        LivingLamp2.SetPower(0.0);
        LivingLamp3.SetPower(0.0);
        LivFan.SetPower(0.0);
        clock.SetStatus(true);
        curtain.SetStatus(true);

        camera.SetPower(false);

        component.SetPower(true);

        fan.setPower(true);
    }
    if( !exLiving.mah && exLiving.Alice ){
        dvLight.SetPower(0.0);
        LivingLamp1.SetPower(1.0);
        LivingLamp2.SetPower(0.0);
        LivingLamp3.SetPower(0.0);
        LivFan.SetPower(0.0);
        clock.SetStatus(true);
        curtain.SetStatus(true);

        camera.SetPower(false);

        component.SetPower(true);

        fan.setPower(true);



}


}

谁能帮帮我,我已经给出了项目的链接。这是一个模拟。

【问题讨论】:

  • 为什么你认为这是一个java文件,或者和eclipse有关?对我来说,这似乎是一些特定领域的语言。

标签: java eclipse rule


【解决方案1】:

这不是一个Java 文件,而是一个资源 文件。您将在 Java 代码中的某处看到 ClassClassLoader 实例上的 getResourcegetResourceAsStream 之类的调用,该实例具有此资源的名称,以查找该文件并使用 Java I/O API 读取/解析它.

【讨论】:

  • 好的亲爱的,我明白了你的想法,让我把所有的.class转换成.java,然后搜索它。谢谢
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-10-07
  • 2014-07-15
  • 2013-05-27
  • 2023-03-18
  • 2014-11-01
  • 2011-08-16
相关资源
最近更新 更多