com.esri.arcgis.geodatabaseui
Class Calculator

java.lang.Object
  extended by com.esri.arcgis.geodatabaseui.Calculator
All Implemented Interfaces:
ICalculator, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class Calculator
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, ICalculator

Calculator engine which is used by the UI and can be used independently.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
Calculator()
          Constructs a Calculator using ArcGIS Engine.
Calculator(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Calculator theCalculator = (Calculator) obj;
 
Method Summary
 IEnvelope calculate()
          Performs the calculation by executing the pre-expression and expression.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 String getExpression()
          Expression or value applied to a field in each row of the cursor.
 String getPreExpression()
          A pre-calculation determination of a value or variable that may be used as the expression (or value) of the calculation.
 int hashCode()
          the hashcode for this object
 boolean isShowErrorPrompt()
          Indicates whether to show a message prompt when an error occurs during calculation.
 void setCallbackByRef(ICalculatorCallback rhs1)
          The call back routine.
 void setCursorByRef(ICursor rhs1)
          Cursor used to access the rows on which the calculation will be performed.
 void setExpression(String pExpression)
          Expression or value applied to a field in each row of the cursor.
 void setField(String rhs1)
          Field to perform the calculation on.
 void setPreExpression(String pPreExpression)
          A pre-calculation determination of a value or variable that may be used as the expression (or value) of the calculation.
 void setShowErrorPrompt(boolean pShowPrompt)
          Indicates whether to show a message prompt when an error occurs during calculation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

Calculator

public Calculator()
           throws IOException,
                  UnknownHostException
Constructs a Calculator using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

Calculator

public Calculator(Object obj)
           throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
Calculator theCalculator = (Calculator) obj;

Construct a Calculator using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to Calculator.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

setCursorByRef

public void setCursorByRef(ICursor rhs1)
                    throws IOException,
                           AutomationException
Cursor used to access the rows on which the calculation will be performed.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setCursorByRef in interface ICalculator
Parameters:
rhs1 - A reference to a com.esri.arcgis.geodatabase.ICursor (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IQueryFilter

setCallbackByRef

public void setCallbackByRef(ICalculatorCallback rhs1)
                      throws IOException,
                             AutomationException
The call back routine.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setCallbackByRef in interface ICalculator
Parameters:
rhs1 - A reference to a com.esri.arcgis.geodatabaseui.ICalculatorCallback (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setField

public void setField(String rhs1)
              throws IOException,
                     AutomationException
Field to perform the calculation on.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setField in interface ICalculator
Parameters:
rhs1 - The rhs1 (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IField

setPreExpression

public void setPreExpression(String pPreExpression)
                      throws IOException,
                             AutomationException
A pre-calculation determination of a value or variable that may be used as the expression (or value) of the calculation.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setPreExpression in interface ICalculator
Parameters:
pPreExpression - The pPreExpression (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPreExpression

public String getPreExpression()
                        throws IOException,
                               AutomationException
A pre-calculation determination of a value or variable that may be used as the expression (or value) of the calculation.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getPreExpression in interface ICalculator
Returns:
The pPreExpression
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setExpression

public void setExpression(String pExpression)
                   throws IOException,
                          AutomationException
Expression or value applied to a field in each row of the cursor.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setExpression in interface ICalculator
Parameters:
pExpression - The pExpression (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getExpression

public String getExpression()
                     throws IOException,
                            AutomationException
Expression or value applied to a field in each row of the cursor.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
getExpression in interface ICalculator
Returns:
The pExpression
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

calculate

public IEnvelope calculate()
                    throws IOException,
                           AutomationException
Performs the calculation by executing the pre-expression and expression.

Remarks

The calculate method returns an Envelope which covers features that have been modified by the calculation. This envelope can be used to refresh the display for the calculated area only. If the table used in the calculate is non-spatial, a null is returned.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
calculate in interface ICalculator
Returns:
A reference to a com.esri.arcgis.geometry.IEnvelope
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setShowErrorPrompt

public void setShowErrorPrompt(boolean pShowPrompt)
                        throws IOException,
                               AutomationException
Indicates whether to show a message prompt when an error occurs during calculation.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
setShowErrorPrompt in interface ICalculator
Parameters:
pShowPrompt - The pShowPrompt (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isShowErrorPrompt

public boolean isShowErrorPrompt()
                          throws IOException,
                                 AutomationException
Indicates whether to show a message prompt when an error occurs during calculation.

Product Availability

Available with ArcGIS Desktop.

Supported Platforms

Windows

Specified by:
isShowErrorPrompt in interface ICalculator
Returns:
The pShowPrompt
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.