|
|||||||||
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 an 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()
Gets a style group for the export. |
int |
hashCode()
Returns the hash code value for this runtime info. |
boolean |
isHighPrecision()
Checks the precision of RuntimeInfo. |
void |
setExportStyleGroup(java.lang.String styleGroup)
Sets a style group for the export 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
- The style group for the export.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 info are defined to be equal if they contain the equal info. This definition ensures that the equal method works properly across different implementations of the RuntimeInfo interface.
equals
in class java.lang.Object
o
- The object to be compared for equality with this runtime info.
int hashCode()
hashCode = 1; 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 = 31 * hashCode + c; }This ensures that info1.equals(info2), which implies that info1.hashCode()==info2.hashCode() for any two info, info1 and info2, as required by the general contract of Object.hashCode.
hashCode
in class java.lang.Object
Object.hashCode()
,
Object.equals(Object)
,
equals(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |