Deselect a segment

@param segment Segment to deselect
166651
protected void deselectSegment(Segment segment) {
    if(segment.isUnpaired()) {
      ArrayList<Segment> remove = new ArrayList<>();
      // remove all object segments associated with unpaired segment from
      // selection list
      for(Entry<Segment, Segment> entry : indirectSelections.entrySet()) {
        if(entry.getValue() == segment) {
          remove.add(entry.getKey());
        }
      }

      for(Segment other : remove) {
        indirectSelections.remove(other);
        deselectSegment(other);
      }
    }
    else {
      // check if deselected object Segment has a unpaired segment highlighted
      Segment unpaired = indirectSelections.get(segment);
      if(unpaired != null) {
        // remove highlight
        deselectSegment(unpaired);
      }
      if(selectedSegments.remove(segment) && segment.getDBIDs() != null) {
        unselectedObjects.addDBIDs(segment.getDBIDs());
      }
    }
  }
1024654
public void setSegmentFactory(SegmentFactory segmentFactory) {
        if(segmentFactory == null) {
            throw new IllegalArgumentException("Invalid segmentFactory: " + segmentFactory);
        }
        
        this._segmentFactory = segmentFactory;
        this._properties.setProperty(PARAM_SEGMENT_FACTORY_CLASS, segmentFactory.getClass().getName());
    }
1038780
@Deprecated
    @SuppressWarnings("unchecked")
    public static void deselect(final FastAdapter adapter) {
        adapter.recursive(new AdapterPredicate() {
            @Override
            public boolean apply(@NonNull IAdapter lastParentAdapter, int lastParentPosition, @NonNull IItem item, int position) {
                if (position != -1) {
                    SelectExtension extension = (SelectExtension) adapter.getExtension(SelectExtension.class);
                    if (extension != null) {
                        extension.deselect(position);
                    }
                } else {
                    item.withSetSelected(false);
                }
                return true;
            }
        }, false);
    }
353085
public void deselect(Iterable<Integer> positions) {
        Iterator<Integer> entries = positions.iterator();
        while (entries.hasNext()) {
            deselect(entries.next(), entries);
        }
    }
920713
public void removeTickMarkSection(final Section SECTION) {
        if (null == SECTION) return;
        tickMarkSections.remove(SECTION);
        Collections.sort(tickMarkSections, new SectionComparator());
        fireUpdateEvent(REDRAW_EVENT);
    }
547835
public void freeSegment(SegmentKelp segment)
    throws IOException
  {
    freeTableSegmentLength(segment.length());
    
    // System.out.println("FREE: " + _tableLength + " " + segment.getLength() + " " + segment);
    
    _segmentService.freeSegment(segment);
  }
115158
def delete_segments(self, segments):
        """"""
        for segment in segments:
            s_res = MechResource(segment['id'], a_const.SEGMENT_RESOURCE,
                                 a_const.DELETE)
            self.provision_queue.put(s_res)
920618
def removeSegmentUpdate(self, updateInfo):
    

    # An updateInfo contains (creationDate, SegmentUpdate)
    (creationDate, segUpdate) = updateInfo

    # Key is stored in segUpdate itself...
    key = (segUpdate.columnIdx, segUpdate.cellIdx)

    self.segmentUpdates[key].remove(updateInfo)
1368515
function(segments) {
        var previousSegment = [-1, -1];
        var segmentIndicesToRemove = [];
        var cleanedSegmentArray = [];
        var i, ii;
        for (i = 0, ii = segments.length; i < ii; ++i) {
            if (!(previousSegment[0] <= segments[i][0] &&
                    previousSegment[1] >= segments[i][1])) {
                cleanedSegmentArray.push(segments[i]);
            }
            previousSegment = segments[i];
        }

        segments.length = 0;
        for (i = 0, ii = cleanedSegmentArray.length; i < ii; ++i) {
            segments.push(cleanedSegmentArray[i]);
        }
    }
885043
JournalSegment<E> resetSegments(long index) {
    assertOpen();

    // If the index already equals the first segment index, skip the reset.
    JournalSegment<E> firstSegment = getFirstSegment();
    if (index == firstSegment.index()) {
      return firstSegment;
    }

    for (JournalSegment<E> segment : segments.values()) {
      segment.close();
      segment.delete();
    }
    segments.clear();

    JournalSegmentDescriptor descriptor = JournalSegmentDescriptor.builder()
        .withId(1)
        .withIndex(index)
        .withMaxSegmentSize(maxSegmentSize)
        .withMaxEntries(maxEntriesPerSegment)
        .build();
    currentSegment = createSegment(descriptor);
    segments.put(index, currentSegment);
    return currentSegment;
  }
420261
public function offsetSet($offset, $segment)
	{
		if (is_null($offset)) {
			$this->segments[] = (string) $segment;
		} else {
			$this->segments[$offset] = (string) $segment;
		}
	}
1128209
protected void submitSegmentIndexBuffer() {
        if(_sibEnabled && !_sib.isDirty()) {
            _sib.setSegmentId(_segment.getSegmentId());
            _sib.setSegmentLastForcedTime(_segment.getLastForcedTime());
            _segmentManager.submit(_sib);
        } else {
            _segmentManager.remove(_sib);
        }
    }
309354
protected void fireSegmentRemoved(RoadSegment segment) {
		if (this.listeners != null && isEventFirable()) {
			for (final RoadNetworkListener listener : this.listeners) {
				listener.onRoadSegmentRemoved(this, segment);
			}
		}
	}
1046932
public boolean remove(SegmentIndexBuffer sib) {
        if(sib == null) {
            return false;
        }
        
        _sibLookup.remove(sib.getSegmentId());
        return true;
    }
1343061
private void checkEntry(long index, Segment segment, Segment compactSegment) {
    try (Entry entry = segment.get(index)) {
      // If an entry was found, only remove the entry from the segment if it's not a tombstone that has been released.
      if (entry != null) {
        checkEntry(index, entry, segment, compactSegment);
      } else {
        compactSegment.skip(1);
      }
    }
  }
1232647
@When("^I de-select every item on the element on index '(\\d+?)'$")
    public void elementDeSelect(Integer index) {
        Select sel = null;
        sel = new Select(commonspec.getPreviousWebElements().getPreviousWebElements().get(index));

        if (sel.isMultiple()) {
            sel.deselectAll();
        }
    }
908925
void recycleSegment(final CommitLogSegment segment)
    {
        boolean archiveSuccess = CommitLog.instance.archiver.maybeWaitForArchiving(segment.getName());
        activeSegments.remove(segment);
        if (!archiveSuccess)
        {
            // if archiving (command) was not successful then leave the file alone. don't delete or recycle.
            discardSegment(segment, false);
            return;
        }
        if (isCapExceeded())
        {
            discardSegment(segment, true);
            return;
        }

        logger.debug("Recycling {}", segment);
        segmentManagementTasks.add(new Callable<CommitLogSegment>()
        {
            public CommitLogSegment call()
            {
                return segment.recycle();
            }
        });
    }