jet.util
Interface RuntimeInfo


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

setHighPrecision

void setHighPrecision(boolean highPrecision)
Sets the precision for Runtimeinfo. The high precision result files refer to PDF, RTF, Excel, Fax, and PS; the low precision result files refer to DHTML, HTML, Applet, XML, and Text. You can also select high or low precision when exporting to RST and RSD.

Parameters:
highPrecision - If true, use high precision; if false, use low precision.

isHighPrecision

boolean isHighPrecision()
Checks the precision of RuntimeInfo.

Returns:
true if it is high precision, and false if it is low precision.

setExportStyleGroup

void setExportStyleGroup(java.lang.String styleGroup)
Sets a style group for the export to this info.

Parameters:
styleGroup - The style group for the export.

getExportStyleGroup

java.lang.String getExportStyleGroup()
Gets a style group for the export.

Returns:
The style group for the export.

equals

boolean equals(java.lang.Object o)
Compares the specified object with this runtime info for equality. Returns true if and only if the specified object is also a runtime info, both runtime info have the equal info including all info in runtime info. (Two infos , info1 and info2 are equal if the result of the following calculation is true.
        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.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to be compared for equality with this runtime info.
Returns:
true if the specified object is equal to this runtime info.

hashCode

int hashCode()
Returns the hash code value for this runtime info. The hash code of a runtime info is defined to be the result of the following calculation:
        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.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code value for this runtime info.
See Also:
Object.hashCode(), Object.equals(Object), equals(Object)