Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.expressions
Class Expression


java.lang.Object
  extended by 
org.eclipse.core.expressions.Expression
Direct Known Subclasses:
ActiveShellExpression, LegacyHandlerSubmissionExpression

public abstract class Expression
extends Object

Abstract base class for all expressions provided by the common expression language.

An expression is evaluated by calling evaluate(IEvaluationContext).

This class may be subclassed to provide specific expressions.

Since:
3.0

Field Summary
protected static  String ATT_VALUE
          Name of the value attribute of an expression (value is value).
static  Expression FALSE
          The expression corresponding to EvaluationResult.FALSE.
protected static int HASH_CODE_NOT_COMPUTED
          The constant integer hash code value meaning the hash code has not yet been computed.
protected static int HASH_FACTOR
          A factor for computing the hash code for all expressions.
static  Expression TRUE
          The expression corresponding to EvaluationResult.TRUE.
 
Constructor Summary
Expression ()
           
 
Method Summary
 void collectExpressionInfo ( ExpressionInfo info)
          Collects information about this expression tree.
  ExpressionInfo computeExpressionInfo ()
          Computes the expression information for the given expression tree.
protected  int computeHashCode ()
          Method to compute the hash code for this object.
protected static boolean equals ( Object[] leftArray, Object[] rightArray)
          Tests whether two arrays of objects are equal to each other.
protected static boolean equals ( Object left, Object right)
          Checks whether two objects are equal using the equals(Object) method of the left object.
abstract   EvaluationResult evaluate ( IEvaluationContext context)
          Evaluates this expression.
 int hashCode ()
          
protected static int hashCode ( Object object)
          Returns the hash code for the given object.
protected static int hashCode ( Object[] array)
          Returns the hash code for the given array.
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASH_CODE_NOT_COMPUTED

protected static final int HASH_CODE_NOT_COMPUTED
The constant integer hash code value meaning the hash code has not yet been computed.

See Also:
Constant Field Values

HASH_FACTOR

protected static final int HASH_FACTOR
A factor for computing the hash code for all expressions.

See Also:
Constant Field Values

ATT_VALUE

protected static final 
String ATT_VALUE
Name of the value attribute of an expression (value is value).

See Also:
Constant Field Values

TRUE

public static final 
Expression TRUE
The expression corresponding to EvaluationResult.TRUE.


FALSE

public static final 
Expression FALSE
The expression corresponding to EvaluationResult.FALSE.

Constructor Detail

Expression

public Expression()
Method Detail

equals

protected static final boolean equals(
Object left,
                                      
Object right)
Checks whether two objects are equal using the equals(Object) method of the left object. This method handles null for either the left or right object.

Parameters:
left - the first object to compare; may be null.
right - the second object to compare; may be null.
Returns:
true if the two objects are equivalent; false otherwise.
Since:
3.2

equals

protected static final boolean equals(
Object[] leftArray,
                                      
Object[] rightArray)
Tests whether two arrays of objects are equal to each other. The arrays must not be null, but their elements may be null.

Parameters:
leftArray - the left array to compare; may be null, and may be empty and may contain null elements.
rightArray - the right array to compare; may be null, and may be empty and may contain null elements.
Returns:
true if the arrays are equal length and the elements at the same position are equal; false otherwise.
Since:
3.2

hashCode

protected static final int hashCode(
Object object)
Returns the hash code for the given object. This method handles null.

Parameters:
object - the object for which the hash code is desired; may be null.
Returns:
The hash code of the object; zero if the object is null.
Since:
3.2

hashCode

protected static final int hashCode(
Object[] array)
Returns the hash code for the given array. This method handles null.

Parameters:
array - the array for which the hash code is desired; may be null.
Returns:
the hash code of the array; zero if the object is null.
Since:
3.2

evaluate

public abstract 
EvaluationResult evaluate(
IEvaluationContext context)
                                   throws 
CoreException
Evaluates this expression.

Parameters:
context - an evaluation context providing information like variable, name spaces, etc. necessary to evaluate this expression
Returns:
the result of the expression evaluation
Throws:
CoreException - if the evaluation failed. The concrete reason is defined by the subclass implementing this method

computeExpressionInfo

public final 
ExpressionInfo computeExpressionInfo()
Computes the expression information for the given expression tree.

This is a convenience method for collecting the expression information using collectExpressionInfo(ExpressionInfo).

Returns:
the expression information
Since:
3.2

collectExpressionInfo

public void collectExpressionInfo(
ExpressionInfo info)
Collects information about this expression tree. This default implementation add the expression's type to the set of misbehaving expression types.

Parameters:
info - the expression information object used to collect the information
Since:
3.2

computeHashCode

protected int computeHashCode()
Method to compute the hash code for this object. The result returned from this method in cached in the fHashCode field. If the value returned from the method equals HASH_CODE_NOT_COMPUTED (e.g. -1) then the value is incremented by one.

This default implementation calls super.hashCode()

Returns:
a hash code for this object.
Since:
3.2

hashCode

public int hashCode()

Overrides:
hashCode in class Object

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire