Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

ENTERPRISE PROGRAMS

Name: Anonymous 2012-01-01 0:10

ENTERPRISE SOLUTIONS FOR A BETTER /PROG/

/*
 * Import util.* for List and ArrayList
 */
import java.util.*;
public final class IntegerThreeDimensionalMapFactory
{
    /*
     * Function : makeMap
     * Arguments: int xCoordinate  -> The number of values in the X dimension
     *          : int yCoordinate  -> The number of values in the Y dimension
     *          : int zCoordinate  -> The number of values in the Z dimension
     *            : int initialValue -> The initial value of each point
     * Returns  : List<List<List<Integer>>> -> The initialized 3 dimensional map
     */
    public static final List<List<List<Integer>>> makeNewThreeDimensionalIntegerMap(final int xCoordinate,
                                                                                    final int yCoordinate,
                                                                                    final int zCoordinate,
                                                                                    final int initialValue){
        // Create our 3 Dimensional List with size xCoordinate
        List<List<List<Integer>>> ThreeDimensionalIntegerMap = new ArrayList<ArrayList<ArrayList<Integer>>>(xCoordinate);
        // Initilize the X,Y,Z Dimensions
        for(int i = 0;i < xCoordinate; i++){
            // Create an inner 2 Dimensional List with size yCoordinate
            List<List<Integer>> TwoDimensionalIntegerMap = new ArrayList<ArrayList<Integer>>(yCoordinate);
            for(int j = 0;j < yCoordinate; j++){
                // Create an inner inner 1 Diemnsional List with size zCoordinate
                List<Integer> OneDimensionalIntegerMap = new ArrayList<Integer>(zCoordinate);
                for(int o = 0;o < zCoordinate; o++){
                    // Initilized an Integer to 0
                    Integer singleDimensionalPoint = new Integer(0);
                    // Add the Integer to the 1D List
                    OneDimensionalIntegerMap.add(singleDimensionalPoint);
                }
                // Add the 1D List to the 2D List
                TwoDimensionalIntegerMap.add(OneDimensionalIntegerMap);
            }
            // Add the 2D List to the 3D List
            ThreeDimensionalIntegerMap.add(TwoDimensionalIntegerMap);
        }
        // Return the 3D List
        return(ThreeDimensionalIntegerMap);
    } //End of makeNewThreeDimensionalIntegerMap method
} // End Of File

Name: Anonymous 2012-01-01 13:21

There should be no exceptions, but I think that was quite funny. I enjoy this excessive exploiting of the "verbosity" of Java.

Name: Anonymous 2012-01-01 15:15

NOW WITH ENTERPRISE ERROR HANDLING


/*
 * Import util.* for List and ArrayList
 */
import java.util.*;
public final class IntegerThreeDimensionalMapFactory
{
    /*
     * The smallest size that xCoordinate can be
     */
    private static final int SMALLEST_X_SIZE = 0;
    /*
     * The smallest size that yCoordinate can be
     */
    private staitc fianl int SMALLEST_Y_SIZE = 0;
    /*
     * The smallest size that zCoordinate can be
     */
    private static final int SMALLEST_Z_SIZE = 0;
    /*
     * Function : makeMap
     * Arguments: int xCoordinate  -> The number of values in the X dimension
     *          : int yCoordinate  -> The number of values in the Y dimension
     *          : int zCoordinate  -> The number of values in the Z dimension
     *            : int initialValue -> The initial value of each point
     * Returns  : List<List<List<Integer>>> -> The initialized 3 dimensional map
     */
    public static final List<List<List<Integer>>> makeNewThreeDimensionalIntegerMap(final int xCoordinate,
                                                                                    final int yCoordinate,
                                                                                    final int zCoordinate,
                                                                                    final int initialValue){
        // Check to make sure you don't initilize the List's to small
        if(xCoordinate <= SMALLEST_X_SIZE){
            throw(new IntegerMapTooSmallException("X Coordinate violates the smallest size requirement"));
        }
        // Check to make sure you don't initilize the List's to small
        if(yCoordinate <= SMALLEST_Y_SIZE){
            throw(new IntegerMapTooSmallException("Y Coordinate violates the smallest size requirement"));
        }
        // Check to make sure you don't initilize the List's to small
        if(zCoordinate <= SMALLEST_Z_SIZE){
            throw(new IntegerMapTooSmallException("Z Coordinate violates the smallest size requirement"));
        }
        // Create our 3 Dimensional List with size xCoordinate
        List<List<List<Integer>>> ThreeDimensionalIntegerMap = new ArrayList<ArrayList<ArrayList<Integer>>>(xCoordinate);
        // Initilize the X,Y,Z Dimensions
        for(int i = 0;i < xCoordinate; i++){
            // Create an inner 2 Dimensional List with size yCoordinate
            List<List<Integer>> TwoDimensionalIntegerMap = new ArrayList<ArrayList<Integer>>(yCoordinate);
            for(int j = 0;j < yCoordinate; j++){
                // Create an inner inner 1 Diemnsional List with size zCoordinate
                List<Integer> OneDimensionalIntegerMap = new ArrayList<Integer>(zCoordinate);
                for(int o = 0;o < zCoordinate; o++){
                    // Initilized an Integer to 0
                    Integer singleDimensionalPoint = new Integer(initialValue);
                    // Add the Integer to the 1D List
                    OneDimensionalIntegerMap.add(singleDimensionalPoint);
                }
                // Add the 1D List to the 2D List
                TwoDimensionalIntegerMap.add(OneDimensionalIntegerMap);
            }
            // Add the 2D List to the 3D List
            ThreeDimensionalIntegerMap.add(TwoDimensionalIntegerMap);
        }
        // Return the 3D List
        return(ThreeDimensionalIntegerMap);
    } //End of makeNewThreeDimensionalIntegerMap method

    /*
     * Exception class given if Coordinate values are too small
     */
    public static class IntegerMapTooSmallException extends RuntimeException {
        // Initlized the Exception
        public IntegerMapTooSmallException(String s){
            //Initilize super class
            super(s);
        }
    }
} // End Of File

Name: Anonymous 2012-01-01 15:19

>>3
Java: public static final int x;
Erlang: X

Name: Anonymous 2012-01-01 15:23

>>3
NOW WITH BETTER SPELLING



/*
 * Import util.* for List and ArrayList
 */
import java.util.*;
public final class IntegerThreeDimensionalMapFactory
{
    /*
     * The smallest size that xCoordinate can be
     */
    private static final int SMALLEST_X_SIZE = 0;
    /*
     * The smallest size that yCoordinate can be
     */
    private static final int SMALLEST_Y_SIZE = 0;
    /*
     * The smallest size that zCoordinate can be
     */
    private static final int SMALLEST_Z_SIZE = 0;
    /*
     * Function : makeMap
     * Arguments: int xCoordinate  -> The number of values in the X dimension
     *          : int yCoordinate  -> The number of values in the Y dimension
     *          : int zCoordinate  -> The number of values in the Z dimension
     *          : int initialValue -> The initial value of each point
     * Returns  : List<List<List<Integer>>> -> The initialized 3 dimensional map
     */
    public static final List<List<List<Integer>>> makeNewThreeDimensionalIntegerMap(final int xCoordinate,
                                                                                    final int yCoordinate,
                                                                                    final int zCoordinate,
                                                                                    final int initialValue){
        // Check to make sure you don't initialize the List's to small
        if(xCoordinate <= SMALLEST_X_SIZE){
            throw(new IntegerMapTooSmallException("X Coordinate violates the smallest size requirement"));
        }
        // Check to make sure you don't initialize the List's to small
        if(yCoordinate <= SMALLEST_Y_SIZE){
            throw(new IntegerMapTooSmallException("Y Coordinate violates the smallest size requirement"));
        }
        // Check to make sure you don't initialize the List's to small
        if(zCoordinate <= SMALLEST_Z_SIZE){
            throw(new IntegerMapTooSmallException("Z Coordinate violates the smallest size requirement"));
        }
        // Create our 3 Dimensional List with size xCoordinate
        List<List<List<Integer>>> ThreeDimensionalIntegerMap = new ArrayList<ArrayList<ArrayList<Integer>>>(xCoordinate);
        // Initialize the X,Y,Z Dimensions
        for(int i = 0;i < xCoordinate; i++){
            // Create an inner 2 Dimensional List with size yCoordinate
            List<List<Integer>> TwoDimensionalIntegerMap = new ArrayList<ArrayList<Integer>>(yCoordinate);
            for(int j = 0;j < yCoordinate; j++){
                // Create an inner inner 1 Dimensional List with size zCoordinate
                List<Integer> OneDimensionalIntegerMap = new ArrayList<Integer>(zCoordinate);
                for(int o = 0;o < zCoordinate; o++){
                    // Initialized an Integer to 0
                    Integer singleDimensionalPoint = new Integer(initialValue);
                    // Add the Integer to the 1D List
                    OneDimensionalIntegerMap.add(singleDimensionalPoint);
                }
                // Add the 1D List to the 2D List
                TwoDimensionalIntegerMap.add(OneDimensionalIntegerMap);
            }
            // Add the 2D List to the 3D List
            ThreeDimensionalIntegerMap.add(TwoDimensionalIntegerMap);
        }
        // Return the 3D List
        return(ThreeDimensionalIntegerMap);
    } //End of makeNewThreeDimensionalIntegerMap method

    /*
     * Exception class given if Coordinate values are too small
     */
    public static class IntegerMapTooSmallException extends RuntimeException {
        // Initialized the Exception
        public IntegerMapTooSmallException(String s){
            //Initialize super class
            super(s);
        }
    }
} // End Of File

Don't change these.
Name: Email:
Entire Thread Thread List