示例#1
0
        public void Add(SpectrumBand <T> band)
        {
            bands.Add(band);

            bounds.GetOrCreateValue(band.GetStart(), v => new SpectrumBound <T>(v)).AddBandStart(band);
            bounds.GetOrCreateValue(band.GetEnd(), v => new SpectrumBound <T>(v)).AddBandEnd(band);

            is_ready = false;
        }
示例#2
0
        public void Remove(SpectrumBand <T> band)
        {
            if (bands.Remove(band))
            {
                int start = bounds.IndexOfKey(band.GetStart());
                if (bounds.IsIndexValid(start))
                {
                    bounds.Values[start].RemoveBandStart(band);
                }

                int end = bounds.IndexOfKey(band.GetEnd());
                if (bounds.IsIndexValid(end))
                {
                    bounds.Values[end].RemoveBandEnd(band);
                }

                is_ready = false;
            }
        }
示例#3
0
 public void RemoveBandEnd(SpectrumBand <T> to_remove)
 {
     ending_bands.Remove(to_remove);
 }
示例#4
0
 public void RemoveBandStart(SpectrumBand <T> to_remove)
 {
     starting_bands.Remove(to_remove);
 }
示例#5
0
 public void AddBandEnd(SpectrumBand <T> to_add)
 {
     ending_bands.Add(to_add);
 }
示例#6
0
 public void AddBandStart(SpectrumBand <T> to_add)
 {
     starting_bands.Add(to_add);
 }