Example usage for java.lang Integer toString

List of usage examples for java.lang Integer toString

Introduction

In this page you can find the example usage for java.lang Integer toString.

Prototype

@HotSpotIntrinsicCandidate
public static String toString(int i) 

Source Link

Document

Returns a String object representing the specified integer.

Usage

From source file:Artemis_Expanded_Skyboxes.System15.java

public static void system15() {

    // Path copyfrom = FileSystems.getDefault().getPath(dirRoot + systemNo + "/" + dirName + "/");
    //Path target = FileSystems.getDefault().getPath("D:/Artemis/art/sb12/");
    //Path target_dir = FileSystems.getDefault().getPath("D:/Artemis/art/sb12");
    for (int x = 12; x <= 29; x++) {
        dirNo = Integer.toString(x);

        File source = new File(sourceDir + dirName + dirNo + "/");
        File dest = new File(targetDir + dirName + dirNo + "/");
        try {//from  w ww  . ja va2s.  c  om
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

From source file:Artemis_Expanded_Skyboxes.System16.java

public static void system16() {

    // Path copyfrom = FileSystems.getDefault().getPath(dirRoot + systemNo + "/" + dirName + "/");
    //Path target = FileSystems.getDefault().getPath("D:/Artemis/art/sb12/");
    //Path target_dir = FileSystems.getDefault().getPath("D:/Artemis/art/sb12");
    for (int x = 12; x <= 29; x++) {
        dirNo = Integer.toString(x);

        File source = new File(sourceDir + dirName + dirNo + "/");
        File dest = new File(targetDir + dirName + dirNo + "/");
        try {//from   www .j  av a2 s .c o m
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

From source file:Artemis_Expanded_Skyboxes.System17.java

public static void system17() {

    // Path copyfrom = FileSystems.getDefault().getPath(dirRoot + systemNo + "/" + dirName + "/");
    //Path target = FileSystems.getDefault().getPath("D:/Artemis/art/sb12/");
    //Path target_dir = FileSystems.getDefault().getPath("D:/Artemis/art/sb12");
    for (int x = 12; x <= 29; x++) {
        dirNo = Integer.toString(x);

        File source = new File(sourceDir + dirName + dirNo + "/");
        File dest = new File(targetDir + dirName + dirNo + "/");
        try {/*from  w  w  w.  ja v  a 2  s .co m*/
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

From source file:Artemis_Expanded_Skyboxes.System18.java

public static void system18() {

    // Path copyfrom = FileSystems.getDefault().getPath(dirRoot + systemNo + "/" + dirName + "/");
    //Path target = FileSystems.getDefault().getPath("D:/Artemis/art/sb12/");
    //Path target_dir = FileSystems.getDefault().getPath("D:/Artemis/art/sb12");
    for (int x = 12; x <= 29; x++) {
        dirNo = Integer.toString(x);

        File source = new File(sourceDir + dirName + dirNo + "/");
        File dest = new File(targetDir + dirName + dirNo + "/");
        try {//from   w ww  . ja  v a2  s.c  o m
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

From source file:Artemis_Expanded_Skyboxes.System19.java

public static void system19() {

    // Path copyfrom = FileSystems.getDefault().getPath(dirRoot + systemNo + "/" + dirName + "/");
    //Path target = FileSystems.getDefault().getPath("D:/Artemis/art/sb12/");
    //Path target_dir = FileSystems.getDefault().getPath("D:/Artemis/art/sb12");
    for (int x = 12; x <= 29; x++) {
        dirNo = Integer.toString(x);

        File source = new File(sourceDir + dirName + dirNo + "/");
        File dest = new File(targetDir + dirName + dirNo + "/");
        try {//w ww. j  a va  2  s  .  c o m
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

From source file:Artemis_Expanded_Skyboxes.System20.java

public static void system20() {

    // Path copyfrom = FileSystems.getDefault().getPath(dirRoot + systemNo + "/" + dirName + "/");
    //Path target = FileSystems.getDefault().getPath("D:/Artemis/art/sb12/");
    //Path target_dir = FileSystems.getDefault().getPath("D:/Artemis/art/sb12");
    for (int x = 12; x <= 29; x++) {
        dirNo = Integer.toString(x);

        File source = new File(sourceDir + dirName + dirNo + "/");
        File dest = new File(targetDir + dirName + dirNo + "/");
        try {// w  ww . j  a va2s.c o m
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

From source file:Main.java

public static boolean isEmpty(String val) {
    return (val == null | "".equals(val) | val.equals(Integer.toString(Integer.MAX_VALUE)));
}

From source file:Main.java

/**
 * Converts the given number into a char-array. If the length of the array
 * is shorter than the required exact length, the array is padded with leading
 * '0' chars. If the array is longer than the wanted length the most
 * significant digits are cut off until the array has the exact length.
 *
 * @param number The number to convert to a char array.
 * @param exactArrayLength The exact length of the returned array.
 * @return The numebr as char array, one char for each decimal digit.
 * @preconditions (exactArrayLength >= 0)
 * @postconditions (result <> null)
 *                 and (result.length == exactArrayLength)
 *//*from   ww w. j a  v a 2  s .  c om*/
public static char[] toCharArray(int number, int exactArrayLength) {
    char[] charArray = null;

    String numberString = Integer.toString(number);
    char[] numberChars = numberString.toCharArray();

    if (numberChars.length > exactArrayLength) {
        // cut off digits beginning at most significant digit
        charArray = new char[exactArrayLength];
        for (int i = 0; i < charArray.length; i++) {
            charArray[i] = numberChars[i];
        }
    } else if (numberChars.length < exactArrayLength) {
        // pad with '0' leading chars
        charArray = new char[exactArrayLength];
        int offset = exactArrayLength - numberChars.length;
        for (int i = 0; i < charArray.length; i++) {
            charArray[i] = (i < offset) ? '0' : numberChars[i - offset];
        }
    } else {
        charArray = numberChars;
    }

    return charArray;
}

From source file:Main.java

private static TrustManager[] prepareTrustManager(InputStream... certificates) {
    if (certificates == null || certificates.length <= 0)
        return null;
    try {//from  w w w  .  ja va  2 s.  c o  m

        CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
        KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
        keyStore.load(null);
        int index = 0;
        for (InputStream certificate : certificates) {
            String certificateAlias = Integer.toString(index++);
            keyStore.setCertificateEntry(certificateAlias, certificateFactory.generateCertificate(certificate));
            try {
                if (certificate != null)
                    certificate.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        TrustManagerFactory trustManagerFactory = null;

        trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        trustManagerFactory.init(keyStore);

        TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();

        return trustManagers;
    } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
    } catch (CertificateException e) {
        e.printStackTrace();
    } catch (KeyStoreException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;

}

From source file:Main.java

private static TrustManager[] prepareTrustManager(InputStream... certificates) {
    if (certificates == null || certificates.length <= 0)
        return null;
    try {//from   w  w w.  jav a  2  s  .  co  m

        CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
        KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
        keyStore.load(null);
        int index = 0;
        for (InputStream certificate : certificates) {
            String certificateAlias = Integer.toString(index++);
            keyStore.setCertificateEntry(certificateAlias, certificateFactory.generateCertificate(certificate));
            try {
                if (certificate != null)
                    certificate.close();
            } catch (IOException e)

            {
            }
        }
        TrustManagerFactory trustManagerFactory = null;

        trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        trustManagerFactory.init(keyStore);

        TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();

        return trustManagers;
    } catch (NoSuchAlgorithmException e) {
        e.printStackTrace();
    } catch (CertificateException e) {
        e.printStackTrace();
    } catch (KeyStoreException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;

}