]> git.uio.no Git - ifi-stolz-refaktor.git/blobdiff - case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints2/ImmutableTypeVariable2.java
Case Study: adding data and statistics
[ifi-stolz-refaktor.git] / case-study / jdt-after / core refactoring / org / eclipse / jdt / internal / corext / refactoring / typeconstraints2 / ImmutableTypeVariable2.java
diff --git a/case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints2/ImmutableTypeVariable2.java b/case-study/jdt-after/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints2/ImmutableTypeVariable2.java
new file mode 100644 (file)
index 0000000..06400bb
--- /dev/null
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.jdt.internal.corext.refactoring.typeconstraints2;
+
+import org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel;
+import org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType;
+
+/**
+ * A ImmutableTypeVariable is a ConstraintVariable which stands for an
+ * immutable type (without an updatable Source location)
+ */
+
+public final class ImmutableTypeVariable2 extends ConstraintVariable2 {
+
+       public ImmutableTypeVariable2(TType type) {
+               super(type);
+       }
+
+       /*
+        * @see java.lang.Object#hashCode()
+        */
+       @Override
+       public int hashCode() {
+               return getType().hashCode();
+       }
+
+       /*
+        * @see java.lang.Object#equals(java.lang.Object)
+        */
+       @Override
+       public boolean equals(Object other) {
+               if (this == other)
+                       return true;
+               if (other.getClass() != ImmutableTypeVariable2.class)
+                       return false;
+
+               return getType() == ((ImmutableTypeVariable2) other).getType();
+       }
+
+       @Override
+       public String toString() {
+               return getType().getPrettySignature();
+       }
+
+       public void generated_5205750030936516946(TType type, InferTypeArgumentsTCModel infertypeargumentstcmodel) {
+               infertypeargumentstcmodel.makeFixedElementVariables(this, type);
+               infertypeargumentstcmodel.makeArrayElementVariable(this);
+       }
+}