lists.CharacterList.CharacterList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of progsbase-to-easyjson Show documentation
Show all versions of progsbase-to-easyjson Show documentation
Adapter Progsbase JSON library to easyjson
package lists.CharacterList;
import references.references.StringReference;
public class CharacterList {
public static char[] AddCharacter(char[] list, char a) {
char[] newlist;
double i;
newlist = new char[(int) (list.length + 1d)];
for (i = 0d; i < list.length; i = i + 1d) {
newlist[(int) (i)] = list[(int) (i)];
}
newlist[(int) (list.length)] = a;
delete(list);
return newlist;
}
public static void AddCharacterRef(StringReference list, char i) {
list.string = AddCharacter(list.string, i);
}
public static char[] RemoveCharacter(char[] list, double n) {
char[] newlist;
double i;
newlist = new char[(int) (list.length - 1d)];
for (i = 0d; i < list.length; i = i + 1d) {
if (i < n) {
newlist[(int) (i)] = list[(int) (i)];
}
if (i > n) {
newlist[(int) (i - 1d)] = list[(int) (i)];
}
}
delete(list);
return newlist;
}
public static char GetCharacterRef(StringReference list, double i) {
return list.string[(int) (i)];
}
public static void RemoveCharacterRef(StringReference list, double i) {
list.string = RemoveCharacter(list.string, i);
}
public static void delete(Object object) {
// Java has garbage collection.
}
}