package org.kevoree.modeling.memory.chunk.impl;

import org.kevoree.modeling.KConfig;
import org.kevoree.modeling.memory.KChunk;
import org.kevoree.modeling.memory.KChunkFlags;
import org.kevoree.modeling.memory.chunk.KLongTree;
import org.kevoree.modeling.memory.space.KChunkSpace;

public class ArrayLongTree extends AbstractArrayTree implements KLongTree {

    public ArrayLongTree(long p_universe, long p_time, long p_obj, KChunkSpace p_space) {
        super(p_universe, p_time, p_obj, p_space);
    }

    public long previousOrEqual(long key) {
        int result = internal_previousOrEqual_index(key);
        if (result != -1) {
            return key(result);
        } else {
            return KConfig.NULL_LONG;
        }
    }

    public void insert(long p_key) {
        internal_insert(p_key, p_key);
    }

    @Override
    public short type() {
        return 0;
    }

}

@@ -275,16 +275,70 @@
 nkSpace;
+%0Aimport org.kevoree.modeling.memory.space.KChunkTypes;
 %0A%0Apublic
@@ -932,9 +932,29 @@
 urn 
-0
+KChunkTypes.LONG_TREE
 ;%0A  

fix chunk type