001 /*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005
006 package org.bridj;
007
008 /**
009 * Wraps a value which size is the same as the 'size_t' C type (32 bits on a 32 bits platform, 64 bits on a 64 bits platform)
010 * @author Olivier
011 */
012 public final class SizeT extends AbstractIntegral {
013
014 public static final int SIZE = Platform.SIZE_T_SIZE;
015
016 public static final SizeT ZERO = new SizeT(0), ONE = new SizeT(1);
017
018 private static final long serialVersionUID = 1547942367767922396L;
019
020 public SizeT(long value) {
021 super(value);
022 }
023
024 public static SizeT valueOf(long value) {
025 if (value == 0)
026 return ZERO;
027 if (value == 1)
028 return ONE;
029 return new SizeT(value);
030 }
031 }