Java Code Examples for org.apache.commons.lang3.ArrayUtils.clone()

The following are Jave code examples for showing how to use clone() of the org.apache.commons.lang3.ArrayUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: sumo   File: KDistributionEstimation.java   View Source Code Vote up 5 votes
/**
 * @param mask
 */
public void estimate(int[] mask,int data[]) {
	detectThresh = new double[6];

	double[] statData = new double[] { 1, 1, 1, 1, 1 };

	computeStat(256 * 256, 1, 1, mask, data,statData);

	clippingThresh = lookUpTable.getClippingThreshFromStd(statData[0]);

	for (int iter = 0; iter < iteration; iter++) {
		computeStat(clippingThresh, 1, 1, mask, data,statData);
		if (iter != iteration - 1) {
			clippingThresh = lookUpTable.getClippingThreshFromClippedStd(statData[0]);
		} else {
			double threshTemp = lookUpTable.getDetectThreshFromClippedStd(statData[0]);
			//fill elements from 1-4 : tile areas
			for (int k = 1; k < 5; k++) {
				detectThresh[k] = threshTemp * statData[k];
			}
			//standard deviation
			detectThresh[0] = statData[0];
			//treshold
			detectThresh[5] = threshTemp;
		}
	}
	tileStat = ArrayUtils.clone(statData);
}
 
Example 2
Project: DecompiledMinecraft   File: GuiKeyBindingList.java   View Source Code Vote up 5 votes
public GuiKeyBindingList(GuiControls controls, Minecraft mcIn)
{
    super(mcIn, controls.width, controls.height, 63, controls.height - 32, 20);
    this.field_148191_k = controls;
    this.mc = mcIn;
    KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(mcIn.gameSettings.keyBindings);
    this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()];
    Arrays.sort((Object[])akeybinding);
    int i = 0;
    String s = null;

    for (KeyBinding keybinding : akeybinding)
    {
        String s1 = keybinding.getKeyCategory();

        if (!s1.equals(s))
        {
            s = s1;
            this.listEntries[i++] = new GuiKeyBindingList.CategoryEntry(s1);
        }

        int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));

        if (j > this.maxListLabelWidth)
        {
            this.maxListLabelWidth = j;
        }

        this.listEntries[i++] = new GuiKeyBindingList.KeyEntry(keybinding);
    }
}
 
Example 3
Project: BaseClient   File: GuiKeyBindingList.java   View Source Code Vote up 5 votes
public GuiKeyBindingList(GuiControls controls, Minecraft mcIn)
{
    super(mcIn, controls.width, controls.height, 63, controls.height - 32, 20);
    this.field_148191_k = controls;
    this.mc = mcIn;
    KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(mcIn.gameSettings.keyBindings);
    this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()];
    Arrays.sort((Object[])akeybinding);
    int i = 0;
    String s = null;

    for (KeyBinding keybinding : akeybinding)
    {
        String s1 = keybinding.getKeyCategory();

        if (!s1.equals(s))
        {
            s = s1;
            this.listEntries[i++] = new GuiKeyBindingList.CategoryEntry(s1);
        }

        int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));

        if (j > this.maxListLabelWidth)
        {
            this.maxListLabelWidth = j;
        }

        this.listEntries[i++] = new GuiKeyBindingList.KeyEntry(keybinding);
    }
}
 
Example 4
Project: BaseClient   File: GuiKeyBindingList.java   View Source Code Vote up 5 votes
public GuiKeyBindingList(GuiControls controls, Minecraft mcIn)
{
    super(mcIn, controls.width, controls.height, 63, controls.height - 32, 20);
    this.field_148191_k = controls;
    this.mc = mcIn;
    KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(mcIn.gameSettings.keyBindings);
    this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()];
    Arrays.sort((Object[])akeybinding);
    int i = 0;
    String s = null;

    for (KeyBinding keybinding : akeybinding)
    {
        String s1 = keybinding.getKeyCategory();

        if (!s1.equals(s))
        {
            s = s1;
            this.listEntries[i++] = new GuiKeyBindingList.CategoryEntry(s1);
        }

        int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));

        if (j > this.maxListLabelWidth)
        {
            this.maxListLabelWidth = j;
        }

        this.listEntries[i++] = new GuiKeyBindingList.KeyEntry(keybinding);
    }
}
 
Example 5
Project: Backmemed   File: GuiKeyBindingList.java   View Source Code Vote up 5 votes
public GuiKeyBindingList(GuiControls controls, Minecraft mcIn)
{
    super(mcIn, controls.width + 45, controls.height, 63, controls.height - 32, 20);
    this.controlsScreen = controls;
    this.mc = mcIn;
    KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(mcIn.gameSettings.keyBindings);
    this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()];
    Arrays.sort((Object[])akeybinding);
    int i = 0;
    String s = null;

    for (KeyBinding keybinding : akeybinding)
    {
        String s1 = keybinding.getKeyCategory();

        if (!s1.equals(s))
        {
            s = s1;
            this.listEntries[i++] = new GuiKeyBindingList.CategoryEntry(s1);
        }

        int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));

        if (j > this.maxListLabelWidth)
        {
            this.maxListLabelWidth = j;
        }

        this.listEntries[i++] = new GuiKeyBindingList.KeyEntry(keybinding);
    }
}
 
Example 6
Project: CustomWorldGen   File: GuiKeyBindingList.java   View Source Code Vote up 5 votes
public GuiKeyBindingList(GuiControls controls, Minecraft mcIn)
{
    super(mcIn, controls.width + 45, controls.height, 63, controls.height - 32, 20);
    this.controlsScreen = controls;
    this.mc = mcIn;
    KeyBinding[] akeybinding = (KeyBinding[])ArrayUtils.clone(mcIn.gameSettings.keyBindings);
    this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()];
    Arrays.sort((Object[])akeybinding);
    int i = 0;
    String s = null;

    for (KeyBinding keybinding : akeybinding)
    {
        String s1 = keybinding.getKeyCategory();

        if (!s1.equals(s))
        {
            s = s1;
            this.listEntries[i++] = new GuiKeyBindingList.CategoryEntry(s1);
        }

        int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));

        if (j > this.maxListLabelWidth)
        {
            this.maxListLabelWidth = j;
        }

        this.listEntries[i++] = new GuiKeyBindingList.KeyEntry(keybinding);
    }
}
 
Example 7
Project: datax   File: BytesColumn.java   View Source Code Vote up 4 votes
public BytesColumn(byte[] bytes) {
	super(ArrayUtils.clone(bytes), Column.Type.BYTES, null == bytes ? 0
			: bytes.length);
}