package org.gnode.nix;

import org.bytedeco.javacpp.Loader;
import org.bytedeco.javacpp.annotation.*;
import org.gnode.nix.base.ImplContainer;
import org.gnode.nix.internal.None;

@Platform(value = "linux",
        include = {"<nix/Dimensions.hpp>"},
        link = {"nix"})
@Namespace("nix")
public class SetDimension extends ImplContainer implements Comparable<SetDimension> {
    static {
        Loader.load();
    }

    //--------------------------------------------------
    // Constructors
    //--------------------------------------------------

    /**
     * Constructor that creates an uninitialized SetDimension.
     * <p/>
     * Calling any method on an uninitialized dimension will throw a {@link java.lang.RuntimeException}.
     */
    public SetDimension() {
        allocate();
    }

    private native void allocate();

    //--------------------------------------------------
    // Base class methods
    //--------------------------------------------------

    public native
    @Cast("bool")
    boolean isNone();

    //--------------------------------------------------
    // Methods concerning SetDimension
    //--------------------------------------------------

    /**
     * The actual dimension that is described by the dimension descriptor.
     * <p/>
     * The index of the dimension entity representing the dimension of the actual
     * data that is defined by this descriptor.
     *
     * @return The dimension index of the dimension.
     */
    public native
    @Name("index")
    @Cast("size_t")
    long getIndex();

    /**
     * The type of the dimension.
     * <p/>
     * This field indicates whether the dimension is a SampledDimension, SetDimension or
     * RangeDimension.
     *
     * @return The dimension type.
     */
    public native
    @Name("dimensionType")
    @ByVal
    @Cast("nix::DimensionType")
    int getDimensionType();

    // public native @StdString @StdVector BytePointer labels();

    // public native void labels(@StdString @StdVector BytePointer labels);

    private native void labels(@Const @ByVal None t);

    /**
     * Remove the labels from the dimension.
     */
    public void removeLabels() {
        labels(new None());
    }

    @Override
    public int compareTo(SetDimension setDimension) {
        if (this == setDimension) {
            return 0;
        }
        return (int) (this.getIndex() - setDimension.getIndex());
    }
}
@@ -171,16 +171,121 @@
 al.None;
+%0Aimport org.gnode.nix.internal.StringVector;%0Aimport org.gnode.nix.internal.Utils;%0A%0Aimport java.util.List;
 %0A%0A@Platf
@@ -2010,59 +2010,51 @@
     
-// public native @Std
+private native%0A    @ByVal%0A    
 String
- @Std
 Vector 
-BytePointer 
 labe
@@ -2069,156 +2069,605 @@
    /
-/ public native void labels(@StdString @StdVector BytePointer labels);%0A%0A    private native void labels(@Const @ByVal None t);%0A%0A    /**%0A     * R
+**%0A     * Get the labels of the range dimension.%0A     * %3Cp/%3E%0A     * The labels serve as names for each index of the data at the respective%0A     * dimension.%0A     *%0A     * @return The labels of the dimension as a list of strings.%0A     */%0A    public List%3CString%3E getLabels() %7B%0A        return Utils.convertStringVectorToList(labels());%0A    %7D%0A%0A    private native void labels(@Const @ByVal StringVector labels);%0A%0A    private native void labels(@Const @ByVal None t);%0A%0A    /**%0A     * Set the labels for the dimension.%0A     *%0A     * @param labels A list containing all new labels. If %7B@link null%7D r
 emove
+s
  the
@@ -2722,25 +2722,153 @@
 oid 
-removeLabels() %7B%0A
+setLabels(List%3CString%3E labels) %7B%0A        if (labels != null) %7B%0A            labels(Utils.convertListToStringVector(labels));%0A        %7D else %7B%0A    
     
@@ -2887,24 +2887,34 @@
 ew None());%0A
+        %7D%0A
     %7D%0A%0A    @

fix labels func for SetDimension