📄 hbyte.java
字号:
package HECore.stddata;
import HPCore.Exception.*;
public class HByte {
double value;
short s;
private static final short H_BYTE = 24;
public HByte(short s)
{
this.s=s;
value=new Short(s).doubleValue();
}
public short getType()
{
return H_BYTE;
}
public String toString()
{
return (new Short(s)).toString();
}
public short byteValue()
{
return s;
}
public String strValue()
{
return toString();
}
public HByte Add(HByte b) throws HpException
{
short value = (short)(byteValue() + b.byteValue());
return new HByte(value);
}
public HByte Sub(HByte b) throws HpException
{
short value = (short)(byteValue() - b.byteValue());
return new HByte(value);
}
public HByte Mult(HByte b) throws HpException
{
short value = (short)(byteValue() * b.byteValue());
return new HByte(value);
}
public HByte DDiv(HByte b) throws HpException
{
short value = (short)(byteValue() / b.byteValue());
return new HByte(value);
}
public float Div(HByte b) throws HpException
{
float value = (float)(byteValue() / b.byteValue());
return value;
}
public HByte And(HByte b) throws HpException
{
short value = (short)(byteValue() & b.byteValue());
return new HByte(value);
}
public HByte Or(HByte b) throws HpException
{
short value = (short)(byteValue() | b.byteValue());
return new HByte(value);
}
public HByte Xor(HByte b) throws HpException
{
short value = (short)(byteValue() ^ b.byteValue());
return new HByte(value);
}
public HByte Imp(HByte b) throws HpException
{
short value = (short)(~(byteValue() & (~b.byteValue())));
return new HByte(value);
}
public HByte Not( ) throws HpException
{
if(byteValue() > 255)
throw new HpException(6,"Overflow");
short mid = (short)~byteValue();
if(mid < 0)
mid = (short)(256 + mid);
return new HByte(mid);
}
public HByte Eqv(HByte b,boolean flag) throws HpException
{
short value = (short)(~(this.byteValue() ^ b.byteValue()));
return new HByte(value);
}
public double Pow(HByte b) throws HpException
{
double value = Math.pow(byteValue(),b.byteValue());
return value ;
}
public HByte Mod(HByte b) throws HpException
{
short value = (short)(this.value % b.dblValue());
return new HByte(value);
}
public boolean Great(HByte b) throws HpException
{
return byteValue()>b.byteValue()?true:false;
}
public boolean Less(HByte b) throws HpException
{
return byteValue()<b.byteValue()?true:false;
}
public boolean Equal(HByte b) throws HpException
{
return byteValue()==b.byteValue()?true:false;
}
public boolean GreatEqual(HByte b) throws HpException
{
return byteValue()>=b.byteValue()?true:false;
}
public boolean LessEqual(HByte b) throws HpException
{
return byteValue()<=b.byteValue()?true:false;
}
public boolean NotEqual(HByte b) throws HpException
{
return byteValue()!=b.byteValue()?true:false;
}
public short intValue()
{
return (short)value;
}
public double dblValue()
{
return value;
}
public float sglValue()
{
return (float)value;
}
public int lngValue()
{
return (int)value;
}
public boolean boolValue()
{
if(value==0)
return false;
else
return true;
}
public boolean Like(HByte b,boolean mode) throws HpException {
return Operator.Like(toString(),b.strValue(),mode);
}
public String Link(HByte b)
{
String s="";
s=toString()+b.toString();
return s;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -