summaryrefslogtreecommitdiff
path: root/sources/scala/runtime/types/TypeInt.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scala/runtime/types/TypeInt.java')
-rw-r--r--sources/scala/runtime/types/TypeInt.java50
1 files changed, 0 insertions, 50 deletions
diff --git a/sources/scala/runtime/types/TypeInt.java b/sources/scala/runtime/types/TypeInt.java
deleted file mode 100644
index 3c29b70c0a..0000000000
--- a/sources/scala/runtime/types/TypeInt.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2005, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-package scala.runtime.types;
-
-import scala.runtime.RunTime;
-import scala.Type;
-import scala.Array;
-import scala.Int;
-
-public class TypeInt extends ValueType {
- private final Int ZERO = RunTime.box_ivalue(0);
- public Object cast(Object o) {
- assert scala.runtime.types.Statistics.incTypeCast();
- if (o == null || o instanceof scala.Int)
- return o;
- else if (o instanceof scala.Double)
- return RunTime.box_ivalue((int)((scala.Double)o).value);
- else if (o instanceof scala.Float)
- return RunTime.box_ivalue((int)((scala.Float)o).value);
- else if (o instanceof scala.Long)
- return RunTime.box_ivalue((int)((scala.Long)o).value);
- else if (o instanceof scala.Short)
- return RunTime.box_ivalue(((scala.Short)o).value);
- else if (o instanceof scala.Char)
- return RunTime.box_ivalue(((scala.Char)o).value);
- else if (o instanceof scala.Byte)
- return RunTime.box_ivalue(((scala.Byte)o).value);
- else
- throw new ClassCastException();
- }
- public Object defaultValue() { return ZERO; }
- public boolean isSameAsJavaType(Class that) {
- return that == java.lang.Integer.TYPE;
- }
- public String toString() { return "scala.Int"; }
- public int hashCode() { return 0x44444444; }
-
- // Make TypeInt a serializable singleton
- public static TypeInt INSTANCE = new TypeInt();
- protected TypeInt() { /* exists only to that instantiation */ }
- private Object readResolve() { return INSTANCE; }
-}