field.java
来自「该内容是关于fdtd的源码,我用过,ok!不错!」· Java 代码 · 共 74 行
JAVA
74 行
public class Component
{
private int imat;
public double xl, xu, yl, yu, zl, zu;
private double time_appear;
public double time;
// private boolean exists;
public Component(int imat, double xl, double xu,
double yl, double yu, double zl, double zu, double time_appear)
{
this.imat=imat;
this.xl=xl;
this.xu=xu;
this.yl=yl;
this.yu=yu;
this.zl=zl;
this.zu=zu;
this.time_appear=time_appear;
}
public boolean exists(double time)
{
if (time>=this.time_appear)
{
// this.exists=true;
return true;
}
else
{
// this.exists=false;
return false;
}
}
public void setImat(int imat)
{
this.imat=imat;
}
public int getImat()
{
return this.imat;
}
public double getTime_appear()
{
return this.time_appear;
}
public boolean in(double x, double y, double z)
{
boolean temp;
temp=false;
if (x>=this.xl)
{ if (x<this.xu)
{ if (y>=this.yl)
{ if (y<this.yu)
{ if (z>=this.zl)
{ if (z<this.zu) temp=true;
}
}
}
}
}
return temp;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?