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 TypeMethodDescriptionboolean
Add a value, do not allow duplicatesdouble
Get the average wire position (zero-based) Duplicate weightings are used via the counts arrayvoid
clear()
double
delFromAverage
(int wire) int
getCount
(int wire) Get the repeat count for this wireboolean
Is a given list a subset of this listboolean
void
sort()
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, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods 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:
toString
in 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:
true
if it is a subset
-