Package cnuphys.snr

Class WireList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess

public class WireList extends ArrayList<Integer>
Author:
heddle A wire list is a list of wires (0-based) For CLAS12 [0..111]
See Also:
  • Constructor Details

    • WireList

      public WireList(int numWires)
      Create a wirelist
  • Method Details

    • sort

      public void sort()
    • delFromAverage

      public double delFromAverage(int wire)
    • add

      public boolean add(Integer wire)
      Add a value, do not allow duplicates
      Specified by:
      add in interface Collection<Integer>
      Specified by:
      add in interface List<Integer>
      Overrides:
      add in class ArrayList<Integer>
      Parameters:
      wire - the 0-based value to add
      Returns:
      true as required.
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<Integer>
      Specified by:
      remove in interface List<Integer>
      Overrides:
      remove in class ArrayList<Integer>
    • 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()
      Specified by:
      clear in interface Collection<Integer>
      Specified by:
      clear in interface List<Integer>
      Overrides:
      clear in class ArrayList<Integer>
    • toString

      public String toString()
      A string representation. Note wires are zero-based, but we print them out 1-based. Ugh.
      Overrides:
      toString in class AbstractCollection<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

      public boolean hasSubset(WireList wl)
      Is a given list a subset of this list
      Parameters:
      wl - the given list
      Returns:
      true if it is a subset