@@ -0,0 +1,2023 @@
+/*%0A * Copyright (C) 2017 team-cachebox.de%0A *%0A * Licensed under the : GNU General Public License (GPL);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.gnu.org/licenses/gpl.html%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage de.longri.cachebox3.translation;%0A%0Aimport com.badlogic.gdx.utils.CharArray;%0A%0A/**%0A *%0A * Created by Longri on 25.10.17.%0A */%0Apublic class MutableString implements CharSequence %7B%0A%0A%0A    private final CharArray storage;%0A    private int ptr;%0A    private int length;%0A%0A    public MutableString(CharArray storage, CharSequence string) %7B%0A        this.storage = storage;%0A        ptr = storage.size;%0A        length = string.length();%0A%0A        if (string instanceof MutableString) %7B%0A            MutableString mutableString = (MutableString) string;%0A            if (storage == mutableString.storage) %7B%0A                //same storage, so copy pointer%0A                ptr = mutableString.ptr;%0A            %7D else %7B%0A                // add char%5B%5D%0A                this.storage.addAll(mutableString.storage.items, mutableString.ptr, length);%0A            %7D%0A        %7D else if (string instanceof String) %7B%0A            char%5B%5D arr = ((String) string).toCharArray();%0A            this.storage.addAll(arr);%0A        %7D else %7B%0A            //copy char by char%0A            for (int i = 0; i %3C length; i++) %7B%0A                this.storage.add(string.charAt(i));%0A            %7D%0A        %7D%0A    %7D%0A%0A%0A    @Override%0A    public int length() %7B%0A        return length;%0A    %7D%0A%0A    @Override%0A    public char charAt(int index) %7B%0A        return storage.get(ptr + index);%0A    %7D%0A%0A    @Override%0A    public CharSequence subSequence(int start, int end) %7B%0A        return null;%0A    %7D%0A%7D%0A

add MutableString