Class WireList
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess, SequencedCollection<Integer>
-
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdd a value, do not allow duplicatesdoubleGet the average wire position (zero-based) Duplicate weightings are used via the counts arrayvoidclear()doubledelFromAverage(int wire) intgetCount(int wire) Get the repeat count for this wirebooleanIs a given list a subset of this listbooleanvoidsort()toString()A string representation.Methods inherited from class ArrayList
add, addAll, addAll, addFirst, addLast, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAllMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Constructor Details
-
WireList
public WireList(int numWires) Create a wirelist
-
-
Method Details
-
sort
public void sort() -
delFromAverage
public double delFromAverage(int wire) -
add
-
remove
-
getCount
public int getCount(int wire) Get the repeat count for this wire- Parameters:
wire- the 0-based wire index- Returns:
- the repeat count
-
clear
-
toString
A string representation. Note wires are zero-based, but we print them out 1-based. Ugh.- Overrides:
toStringin classAbstractCollection<Integer>
-
averageWirePosition
public double averageWirePosition()Get the average wire position (zero-based) Duplicate weightings are used via the counts array- Returns:
- the average wire position
-
hasSubset
Is a given list a subset of this list- Parameters:
wl- the given list- Returns:
trueif it is a subset
-