import java.util.*;

public class Command
{
    public static final String MASK = "mask";
    public static final String MEM = "mem";
    public static final String OPEN_BRACE = "[";
    public static final String CLOSE_BRACE = "]";
    public static final String EQUALS = "=";

    public static final char FLOATING_BIT = 'X';

    public static final int INTEGER_SIZE = 36;

    public Command (String mask, Vector<String> cmds, boolean debug)
    {
        _mask = mask;
        _commands = cmds;
        _debug = debug;
    }

    public void execute (Memory mem)
    {
        String theMask = _mask.substring(_mask.indexOf(EQUALS) +1).trim();

        if (_debug)
            System.out.println("Bitmask is: "+theMask);

        for (int i = 0; i < _commands.size(); i++)
        {
            int startIndex = _commands.elementAt(i).indexOf(OPEN_BRACE);
            int endIndex = _commands.elementAt(i).indexOf(CLOSE_BRACE);
            String addrStr = _commands.elementAt(i).substring(startIndex +1, endIndex);
            Long addr = Long.parseLong(addrStr);

            if (_debug)
                System.out.println("Memory address: "+addr);

            startIndex = _commands.elementAt(i).indexOf(EQUALS);

            String valueStr = _commands.elementAt(i).substring(startIndex +1).trim();
            Long value = Long.parseLong(valueStr);

            if (_debug)
                System.out.println("Value: "+value);

            Vector<String> addresses = applyMask(theMask, addr);
        }
    }

    @Override
    public String toString ()
    {
        String str = _mask;

        for (int i = 0; i < _commands.size(); i++)
        {
            str += "\n" + _commands.elementAt(i);
        }

        return str;
    }

    private Vector<String> applyMask (String mask, long address)
    {
        char[] theMaskArray = mask.toCharArray();
        Vector<String> masks = new Vector<String>();
        int count = 0;

        for (int i = 0; i < theMaskArray.length; i++)
        {
            if (theMaskArray[i] == FLOATING_BIT)
                count++;
        }

        if (count > 0)
        {
            int[] options = new int[count];
        }
        else
            masks.add(mask);


        return masks;
    }

    private String _mask;
    private Vector<String> _commands;
    private boolean _debug;
}
@@ -1434,74 +1434,8 @@
 ue);
-%0A%0A            Vector%3CString%3E addresses = applyMask(theMask, addr);
 %0A   
@@ -1707,458 +1707,50 @@
 ng%3E 
-applyMask (String mask, long address)%0A    %7B%0A        char%5B%5D theMaskArray = mask.toCharArray();%0A        Vector%3CString%3E masks = new Vector%3CString%3E();%0A        int count = 0;%0A%0A        for (int i = 0; i %3C theMaskArray.length; i++)%0A        %7B%0A            if (theMaskArray%5Bi%5D == FLOATING_BIT)%0A                count++;%0A        %7D%0A%0A        if (count %3E 0)%0A        %7B%0A            int%5B%5D options = new int%5Bcount%5D;%0A        %7D%0A        else%0A            masks.add(mask);%0A%0A
+generateAllAddresses (String addres)%0A    %7B
 %0A   
@@ -1765,19 +1765,15 @@
 urn 
-masks;%0A    
+null;%0A%09
 %7D%0A%0A 

Update Command.java