Dresden OCL Toolkit

tudresden.ocl.check.types.xmifacade
Class ModelOperation

java.lang.Object
  extended bytudresden.ocl.check.types.xmifacade.ModelOperation
All Implemented Interfaces:
Comparable

public final class ModelOperation
extends Object
implements Comparable

Note: Operations value identity is determined by name and parameter types only. Return type and isquery flag are not significant for value identity. Method equals and hashCode are implemented accordingly.

See Also:
equals(Object), hashCode()

Field Summary
private  int hash
          Implements hashCode to be compatible to equals, according to the semantics of Object.hashCode().
private  boolean isquery
           
private  String name
           
private  Type[] params
           
private  ModelClass parent
           
private  Type type
           
 
Constructor Summary
ModelOperation(String name, Type[] params, Type type, boolean isquery)
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
          Returns true, if both operations have the same signature.
 String getName()
           
 Type[] getParams()
           
 ModelClass getParent()
           
 Type getType()
           
 int hashCode()
           
 boolean isQuery()
           
 boolean matchesTo(Type[] other)
           
 void printData(PrintStream o)
           
 void setParent(ModelClass parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private String name

params

private Type[] params

type

private Type type

isquery

private boolean isquery

parent

private ModelClass parent

hash

private int hash
Implements hashCode to be compatible to equals, according to the semantics of Object.hashCode().

See Also:
equals(Object), Object.hashCode()
Constructor Detail

ModelOperation

public ModelOperation(String name,
                      Type[] params,
                      Type type,
                      boolean isquery)
Method Detail

getName

public String getName()

getParams

public Type[] getParams()

getType

public Type getType()

isQuery

public boolean isQuery()

setParent

public void setParent(ModelClass parent)

getParent

public ModelClass getParent()

matchesTo

public boolean matchesTo(Type[] other)

equals

public boolean equals(Object o)
Returns true, if both operations have the same signature. For each class there shouldn't be two operations beeing equal. This method cannot be used for navigate, since it does not care about polymorphism of parameter types.

See Also:
ModelClass.navigateParameterized(String, Type[])

hashCode

public int hashCode()

toString

public final String toString()

printData

public void printData(PrintStream o)

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.