@Override
    public Object getAttribute(int[] position) {
        switch (position[STREAM_ATTRIBUTE_TYPE_INDEX]) {
            case BEFORE_WINDOW_DATA_INDEX:
                return beforeWindowData[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
            case OUTPUT_DATA_INDEX:
                return outputData[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
            case ON_AFTER_WINDOW_DATA_INDEX:
                return onAfterWindowData[position[STREAM_ATTRIBUTE_INDEX_IN_TYPE]];
            default:
                throw new IllegalStateException("STREAM_ATTRIBUTE_TYPE_INDEX cannot be " +
                        position[STREAM_ATTRIBUTE_TYPE_INDEX]);
        }

    }
@param position int array of 4 elements
                position[0] and position[1] are discarded
                position[2]-BeforeWindowData or OutputData or AfterWindowData, position[3]- which attribute
@return attribute
modules/siddhi-core/src/main/java/io/siddhi/core/event/stream/StreamEvent.java