Exemple #1
0
        public void handle()
        {
            int          startIndex = input.readInt();
            int          endIndex   = input.readInt();
            IntervalRole interval   = intervalFactory.build(startIndex, endIndex);

            array.mirrorInterval(interval);
        }
Exemple #2
0
        public void handle()
        {
            int index = input.readInt();
            int value = array.getValueAt(index);

            output.print(value);
        }
Exemple #3
0
        public void runCommands()
        {
            while (input.hasMoreData())
            {
                int         commandCode    = input.readInt();
                HandlerRole commandHandler = dispatcher.get(commandCode);

                commandHandler.handle();
            }
        }