Package de.isas.lipidomics.domain
Class ModificationsList
- java.lang.Object
-
- de.isas.lipidomics.domain.ModificationsList
-
- All Implemented Interfaces:
Iterable<org.apache.commons.lang3.tuple.Pair<Integer,String>>
,Collection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
,List<org.apache.commons.lang3.tuple.Pair<Integer,String>>
public class ModificationsList extends Object implements List<org.apache.commons.lang3.tuple.Pair<Integer,String>>
- Author:
- nils.hoffmann
-
-
Field Summary
Fields Modifier and Type Field Description protected static ModificationsList
NONE
-
Constructor Summary
Constructors Constructor Description ModificationsList()
ModificationsList(List<org.apache.commons.lang3.tuple.Pair<Integer,String>> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, org.apache.commons.lang3.tuple.Pair<Integer,String> element)
boolean
add(org.apache.commons.lang3.tuple.Pair<Integer,String> e)
boolean
addAll(int index, Collection<? extends org.apache.commons.lang3.tuple.Pair<Integer,String>> c)
boolean
addAll(Collection<? extends org.apache.commons.lang3.tuple.Pair<Integer,String>> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
Integer
countFor(String modification)
Returns the total count (number of elements in this list) with that particular key.Integer
countForHydroxy()
Returns the sum of the occurrence count for modifications with name "OH" in the provided modifications list.void
forEach(Consumer<? super org.apache.commons.lang3.tuple.Pair<Integer,String>> action)
org.apache.commons.lang3.tuple.Pair<Integer,String>
get(int index)
int
indexOf(Object o)
boolean
isEmpty()
Iterator<org.apache.commons.lang3.tuple.Pair<Integer,String>>
iterator()
List<String>
keys()
Returns the modification names stored in this modifications list.int
lastIndexOf(Object o)
ListIterator<org.apache.commons.lang3.tuple.Pair<Integer,String>>
listIterator()
ListIterator<org.apache.commons.lang3.tuple.Pair<Integer,String>>
listIterator(int index)
Stream<org.apache.commons.lang3.tuple.Pair<Integer,String>>
parallelStream()
org.apache.commons.lang3.tuple.Pair<Integer,String>
remove(int index)
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
removeIf(Predicate<? super org.apache.commons.lang3.tuple.Pair<Integer,String>> filter)
void
replaceAll(UnaryOperator<org.apache.commons.lang3.tuple.Pair<Integer,String>> operator)
boolean
retainAll(Collection<?> c)
org.apache.commons.lang3.tuple.Pair<Integer,String>
set(int index, org.apache.commons.lang3.tuple.Pair<Integer,String> element)
int
size()
void
sort(Comparator<? super org.apache.commons.lang3.tuple.Pair<Integer,String>> c)
Spliterator<org.apache.commons.lang3.tuple.Pair<Integer,String>>
spliterator()
Stream<org.apache.commons.lang3.tuple.Pair<Integer,String>>
stream()
List<org.apache.commons.lang3.tuple.Pair<Integer,String>>
subList(int fromIndex, int toIndex)
Object[]
toArray()
<T> T[]
toArray(IntFunction<T[]> generator)
<T> T[]
toArray(T[] a)
String
toString()
-
-
-
Field Detail
-
NONE
protected static final ModificationsList NONE
-
-
Constructor Detail
-
ModificationsList
public ModificationsList()
-
ModificationsList
public ModificationsList(List<org.apache.commons.lang3.tuple.Pair<Integer,String>> list)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
toArray
public <T> T[] toArray(T[] a)
-
set
public org.apache.commons.lang3.tuple.Pair<Integer,String> set(int index, org.apache.commons.lang3.tuple.Pair<Integer,String> element)
-
clear
public void clear()
-
addAll
public boolean addAll(Collection<? extends org.apache.commons.lang3.tuple.Pair<Integer,String>> c)
-
addAll
public boolean addAll(int index, Collection<? extends org.apache.commons.lang3.tuple.Pair<Integer,String>> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
listIterator
public ListIterator<org.apache.commons.lang3.tuple.Pair<Integer,String>> listIterator(int index)
- Specified by:
listIterator
in interfaceList<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
listIterator
public ListIterator<org.apache.commons.lang3.tuple.Pair<Integer,String>> listIterator()
- Specified by:
listIterator
in interfaceList<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
subList
public List<org.apache.commons.lang3.tuple.Pair<Integer,String>> subList(int fromIndex, int toIndex)
-
forEach
public void forEach(Consumer<? super org.apache.commons.lang3.tuple.Pair<Integer,String>> action)
-
spliterator
public Spliterator<org.apache.commons.lang3.tuple.Pair<Integer,String>> spliterator()
- Specified by:
spliterator
in interfaceCollection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
- Specified by:
spliterator
in interfaceIterable<org.apache.commons.lang3.tuple.Pair<Integer,String>>
- Specified by:
spliterator
in interfaceList<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
removeIf
public boolean removeIf(Predicate<? super org.apache.commons.lang3.tuple.Pair<Integer,String>> filter)
- Specified by:
removeIf
in interfaceCollection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
replaceAll
public void replaceAll(UnaryOperator<org.apache.commons.lang3.tuple.Pair<Integer,String>> operator)
- Specified by:
replaceAll
in interfaceList<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
sort
public void sort(Comparator<? super org.apache.commons.lang3.tuple.Pair<Integer,String>> c)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
- Specified by:
containsAll
in interfaceList<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
toArray
public <T> T[] toArray(IntFunction<T[]> generator)
- Specified by:
toArray
in interfaceCollection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
stream
public Stream<org.apache.commons.lang3.tuple.Pair<Integer,String>> stream()
- Specified by:
stream
in interfaceCollection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
parallelStream
public Stream<org.apache.commons.lang3.tuple.Pair<Integer,String>> parallelStream()
- Specified by:
parallelStream
in interfaceCollection<org.apache.commons.lang3.tuple.Pair<Integer,String>>
-
countFor
public Integer countFor(String modification)
Returns the total count (number of elements in this list) with that particular key.- Parameters:
modification
- the modification to count, e.g. "OH".- Returns:
- the number of times this modification occurs, or zero.
-
countForHydroxy
public Integer countForHydroxy()
Returns the sum of the occurrence count for modifications with name "OH" in the provided modifications list.- Returns:
- the sum of the occurrences of OH.
-
-