Package com.ptsmods.mysqlw.collection
Class DbList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
com.ptsmods.mysqlw.collection.DbList<E>
- All Implemented Interfaces:
DbCollection,Iterable<E>,Collection<E>,List<E>
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, @NotNull Collection<? extends E> c) booleanaddAll(@NotNull Collection<? extends E> c) addAllAsync(int index, @NotNull Collection<? extends E> c) addAllAsync(@NotNull Collection<? extends E> c) voidclear()booleanbooleancontainsAll(@NotNull Collection<?> c) containsAllAsync(@NotNull Collection<?> c) @NotNull CompletableFuture<Boolean>get(int index) getAsync(int index) @NotNull DatabasegetDb()static <E> DbList<E>Parses a String representation of a DbList into a DbList.static <E> DbList<E>getList(Database db, String name, BiFunction<E, DbCollection, String> elementToString, BiFunction<String, DbCollection, E> elementFromString) Parses a String representation of a DbList into a DbList.@NotNull StringgetName()@NotNull StringgetTable()intbooleanisEmpty()@NotNull CompletableFuture<Boolean>iterator()@NotNull CompletableFuture<Iterator<E>>int@NotNull ListIterator<E>@NotNull ListIterator<E>listIterator(int index) @NotNull CompletableFuture<ListIterator<E>>@NotNull CompletableFuture<ListIterator<E>>listIteratorAsync(int index) static <E> DbList<E>parseString(Database db, String s, BiFunction<E, DbCollection, String> elementToString, BiFunction<String, DbCollection, E> elementFromString) Parses a String representation of a DbList into a DbList.remove(int index) booleanbooleanremoveAll(@NotNull Collection<?> c) removeAllAsync(@NotNull Collection<?> c) removeAsync(int index) booleanretainAll(@NotNull Collection<?> c) retainAllAsync(@NotNull Collection<?> c) <T> CompletableFuture<T>voidsetExecutor(Executor executor) intsize()@NotNull CompletableFuture<Integer>subList(int fromIndex, int toIndex) @NotNull CompletableFuture<List<E>>subListAsync(int fromIndex, int toIndex) @NotNull Object[]toArray()<T> @NotNull T[]toArray(@NotNull T[] a) <T> @NotNull CompletableFuture<T[]>toArrayAsync(@NotNull T[] a) toString()Methods inherited from class java.util.AbstractList
equals, hashCode, removeRangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Method Details
-
parseString
public static <E> DbList<E> parseString(Database db, String s, BiFunction<E, DbCollection, String> elementToString, BiFunction<String, DbCollection, E> elementFromString) Parses a String representation of a DbList into a DbList.- Type Parameters:
E- The type of the elements in this set.- Parameters:
db- The database this list belongs to. Used when creating a new map.s- The String to parse.elementToString- The function used to convert an element of this list into a String. Used when creating a new list.elementFromString- The function used to convert an element of this list into a String. Used when creating a new list.- Returns:
- A new DbList or a cached one if available.
-
getList
Parses a String representation of a DbList into a DbList.- Type Parameters:
E- The type of the elements in this set.- Parameters:
db- The database this list belongs to. Used when creating a new map.name- The name of this list.type- The Class of type E if you've registered a type converter onDbCF. Used when creating a new list.- Returns:
- A new DbList or a cached one if available.
-
getList
public static <E> DbList<E> getList(Database db, String name, BiFunction<E, DbCollection, String> elementToString, BiFunction<String, DbCollection, E> elementFromString) Parses a String representation of a DbList into a DbList.- Type Parameters:
E- The type of the elements in this set.- Parameters:
db- The database this list belongs to. Used when creating a new map.name- The name of this list.elementToString- The function used to convert an element of this list into a String. Used when creating a new list.elementFromString- The function used to convert an element of this list into a String. Used when creating a new list.- Returns:
- A new DbList or a cached one if available.
-
setExecutor
-
getExecutor
-
runAsync
-
runAsync
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
sizeAsync
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
isEmptyAsync
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Overrides:
containsin classAbstractCollection<E>
-
containsAsync
-
iterator
-
iteratorAsync
-
toArray
- Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Overrides:
toArrayin classAbstractCollection<E>
-
toArrayAsync
-
toArray
@NotNull public <T> @NotNull T[] toArray(@NotNull @NotNull T[] a) - Specified by:
toArrayin interfaceCollection<E>- Specified by:
toArrayin interfaceList<E>- Overrides:
toArrayin classAbstractCollection<E>
-
toArrayAsync
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceList<E>- Overrides:
addin classAbstractList<E>
-
addAsync
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classAbstractCollection<E>
-
removeAsync
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- Overrides:
containsAllin classAbstractCollection<E>
-
containsAllAsync
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceList<E>- Overrides:
addAllin classAbstractCollection<E>
-
addAllAsync
-
addAll
-
addAllAsync
public CompletableFuture<Boolean> addAllAsync(int index, @NotNull @NotNull Collection<? extends E> c) -
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceList<E>- Overrides:
removeAllin classAbstractCollection<E>
-
removeAllAsync
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceList<E>- Overrides:
retainAllin classAbstractCollection<E>
-
retainAllAsync
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-
clearAsync
-
get
-
getAsync
-
set
-
setAsync
-
add
-
addAsync
-
remove
-
removeAsync
-
indexOf
-
indexOfAsync
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<E>- Overrides:
lastIndexOfin classAbstractList<E>
-
lastIndexOfAsync
-
listIterator
- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classAbstractList<E>
-
listIteratorAsync
-
listIterator
- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classAbstractList<E>
-
listIteratorAsync
-
subList
-
subListAsync
-
toString
- Overrides:
toStringin classAbstractCollection<E>
-
getDb
- Specified by:
getDbin interfaceDbCollection- Returns:
- The database this collection works with.
-
getTable
- Specified by:
getTablein interfaceDbCollection- Returns:
- The table this collection works with.
-
getName
- Specified by:
getNamein interfaceDbCollection- Returns:
- The name of this collection. Used to cache and parse from Strings.
-
toArrayList
-
toArrayListAsync
-
getElementFromString
-
getElementToString
-