|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface RuntimeInfo
This interface saves some runtime properties of engine for generating correct results.
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Compares the specified object with this runtime info for equality. |
java.lang.String |
getExportStyleGroup()
Get export style group; |
int |
hashCode()
Returns the hash code value for this runtime info. |
boolean |
isHighPrecision()
Checks the precision of RuntimeInfo. |
void |
setExportStyleGroup(java.lang.String styleGroup)
Set export style group to this info. |
void |
setHighPrecision(boolean highPrecision)
Sets the precision for Runtimeinfo. |
| Method Detail |
|---|
void setHighPrecision(boolean highPrecision)
highPrecision - if true, use high precision; if false, use low precision.boolean isHighPrecision()
void setExportStyleGroup(java.lang.String styleGroup)
styleGroup - export style group.java.lang.String getExportStyleGroup()
boolean equals(java.lang.Object o)
boolean result = true;
if ( isPrimitive(info1) ){
switch ( info.type ){
case boolean:
case byte:
case char:
case int:
case short:
result = info1 == info2;
break;
case double:
result = new Double(info1).equals(new Double(info2));
break;
case float:
result = new Float(info1).equals(new Float(info2));
break;
case long:
result = new Long(info1).equals(new Long(info2));
break;
default :
}
}else{
if ( info1 is exportStyle {
if ( "".equals(info1) ) info1 = null;
if ( "".equals(info2) ) info2 = null;
}
result = info1 == null? (info2 == null): info1.equals(info2);
}
In other words, two runtime infos are defined to be equal if they
contain the equal infos. This definition ensures that the equals
method works properly across different implementations of the
RuntimeInfo interface.
equals in class java.lang.Objecto - the object to be compared for equality with this runtime info.
int hashCode()
hashCode = 0;
for ( each info ){
int c = 0;
if (isPrimitive(info)){
switch info.type{
case boolean:
c = info? 0: 1;
break;
case byte:
case char:
case int:
case short:
c = info;
break;
case double:
c = new Double(info).hashCode();
break;
case float:
c = new Float(info).hashCode();
break;
case long:
c = new Long(info).hashCode();
break;
default :
}
}else{
if ( info is exportStyle && "".equals(info) ) info = null;
c = info == null? 0: info.hashCode();
}
hashCode ^= c;
}
This ensures that info1.equals(info2) implies that
info1.hashCode()==info2.hashCode() for any two infos,
info1 and info2, as required by the general
contract of Object.hashCode.
hashCode in class java.lang.ObjectObject.hashCode(),
Object.equals(Object),
equals(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||