package com.akiban.server.types3.mcompat.mtypes;

import com.akiban.server.types3.TClass;
import com.akiban.server.types3.TCombineMode;
import com.akiban.server.types3.TFactory;
import com.akiban.server.types3.TInstance;
import com.akiban.server.types3.mcompat.MBundle;
import com.akiban.server.types3.pvalue.PUnderlying;

public class MNumeric extends TClass {

    private MNumeric(String name, int serializationSize, PUnderlying pUnderlying) {
        super(MBundle.INSTANCE.id(), name, new String[]{"M"}, 1, 1, serializationSize, pUnderlying);
    }

    @Override
    public TFactory factory() {
        return new MNumericFactory(this);
    }

    @Override
    protected TInstance doCombine(TCombineMode mode, TInstance instance0, TInstance instance1) {
        // Determine precision of TInstance
        /*switch (mode) {
            case COMBINE:
            case CHOOSE:
        }*/
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    // numeric types
    public static final TClass BIT = new MNumeric("bit", 8, PUnderlying.INT_64);
    public static final TClass TINYINT = new MNumeric("tinyint", 1, PUnderlying.INT_8);
    public static final TClass TINYINT_UNSIGNED = new MNumeric("tinyintunsigned", 4, PUnderlying.INT_16);
    public static final TClass SMALLINT = new MNumeric("smallint", 2, PUnderlying.INT_16);
    public static final TClass SMALLINT_UNSIGNED = new MNumeric("smallintunsigned", 4, PUnderlying.INT_32);
    public static final TClass MEDIUMINT = new MNumeric("mediumint", 3, PUnderlying.INT_32);
    public static final TClass MEDIUMINT_UNSIGNED = new MNumeric("mediumintunsigned", 8, PUnderlying.INT_64);
    public static final TClass INT = new MNumeric("int", 4, PUnderlying.INT_32);
    public static final TClass INT_UNSIGNED = new MNumeric("intunsigned", 8, PUnderlying.INT_64);
    public static final TClass BIGINT = new MNumeric("bigint", 8, PUnderlying.INT_64);
    public static final TClass BIGINT_UNSIGNED = new MNumeric("bigintunsigned", 8, PUnderlying.INT_64);
}
@@ -1,8 +1,1242 @@
+/**%0A * END USER LICENSE AGREEMENT (%E2%80%9CEULA%E2%80%9D)%0A *%0A * READ THIS AGREEMENT CAREFULLY (date: 9/13/2011):%0A * http://www.akiban.com/licensing/20110913%0A *%0A * BY INSTALLING OR USING ALL OR ANY PORTION OF THE SOFTWARE, YOU ARE ACCEPTING%0A * ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU AGREE THAT THIS%0A * AGREEMENT IS ENFORCEABLE LIKE ANY WRITTEN AGREEMENT SIGNED BY YOU.%0A *%0A * IF YOU HAVE PAID A LICENSE FEE FOR USE OF THE SOFTWARE AND DO NOT AGREE TO%0A * THESE TERMS, YOU MAY RETURN THE SOFTWARE FOR A FULL REFUND PROVIDED YOU (A) DO%0A * NOT USE THE SOFTWARE AND (B) RETURN THE SOFTWARE WITHIN THIRTY (30) DAYS OF%0A * YOUR INITIAL PURCHASE.%0A *%0A * IF YOU WISH TO USE THE SOFTWARE AS AN EMPLOYEE, CONTRACTOR, OR AGENT OF A%0A * CORPORATION, PARTNERSHIP OR SIMILAR ENTITY, THEN YOU MUST BE AUTHORIZED TO SIGN%0A * FOR AND BIND THE ENTITY IN ORDER TO ACCEPT THE TERMS OF THIS AGREEMENT. THE%0A * LICENSES GRANTED UNDER THIS AGREEMENT ARE EXPRESSLY CONDITIONED UPON ACCEPTANCE%0A * BY SUCH AUTHORIZED PERSONNEL.%0A *%0A * IF YOU HAVE ENTERED INTO A SEPARATE WRITTEN LICENSE AGREEMENT WITH AKIBAN FOR%0A * USE OF THE SOFTWARE, THE TERMS AND CONDITIONS OF SUCH OTHER AGREEMENT SHALL%0A * PREVAIL OVER ANY CONFLICTING TERMS OR CONDITIONS IN THIS AGREEMENT.%0A */%0A%0A
 package 
@@ -3270,10 +3270,14 @@
 INT_64);
+    
 %0A%7D

Add license agreement