project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/NativeSizeT.java
equal
deleted
inserted
replaced
|
1 package org.hedgewars.hedgeroid.frontlib; |
|
2 |
|
3 /** |
|
4 * This class represents the native C type size_t. On Android, this type could be mapped with int, |
|
5 * but we use a separate type to make it easier to adapt for other platforms if anyone wants to use |
|
6 * the mappings elsewhere. |
|
7 */ |
|
8 public final class NativeSizeT extends Number { |
|
9 private static final long serialVersionUID = 1L; |
|
10 private final long value; |
|
11 |
|
12 private NativeSizeT(long value) { |
|
13 this.value = value; |
|
14 } |
|
15 |
|
16 public static NativeSizeT valueOf(long l) { |
|
17 return new NativeSizeT(l); |
|
18 } |
|
19 |
|
20 @Override |
|
21 public int intValue() { |
|
22 return (int)value; |
|
23 } |
|
24 |
|
25 @Override |
|
26 public long longValue() { |
|
27 return value; |
|
28 } |
|
29 |
|
30 @Override |
|
31 public double doubleValue() { |
|
32 return value; |
|
33 } |
|
34 |
|
35 @Override |
|
36 public float floatValue() { |
|
37 return value; |
|
38 } |
|
39 } |