Package cnuphys.snr
Class WireList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Integer>,Collection<Integer>,List<Integer>,RandomAccess
- Author:
- heddle A wire list is a list of wires (0-based) For CLAS12 [0..111]
- See Also:
-
Field Summary
Fields inherited from class java.util.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 java.util.ArrayList
add, addAll, addAll, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll
-
Constructor Details
-
WireList
public WireList(int numWires) Create a wirelist
-
-
Method Details
-
sort
public void sort() -
delFromAverage
public double delFromAverage(int wire) -
add
Add a value, do not allow duplicates -
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
public void 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
-