project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/NativeSizeT.java
changeset 7558 983ff426f91e
child 7584 7831c84cc644
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/NativeSizeT.java	Sat Aug 18 13:39:05 2012 +0200
@@ -0,0 +1,39 @@
+package org.hedgewars.hedgeroid.frontlib;
+
+/**
+ * This class represents the native C type size_t. On Android, this type could be mapped with int,
+ * but we use a separate type to make it easier to adapt for other platforms if anyone wants to use
+ * the mappings elsewhere. 
+ */
+public final class NativeSizeT extends Number {
+	private static final long serialVersionUID = 1L;
+	private final long value;
+	
+	private NativeSizeT(long value) {
+		this.value = value;
+	}
+	
+	public static NativeSizeT valueOf(long l) {
+		return new NativeSizeT(l);
+	}
+	
+	@Override
+	public int intValue() {
+		return (int)value;
+	}
+	
+	@Override
+	public long longValue() {
+		return value;
+	}
+
+	@Override
+	public double doubleValue() {
+		return value;
+	}
+
+	@Override
+	public float floatValue() {
+		return value;
+	}
+}