Inserts static segments into all components.
@param {object} components - The components to process.
@param {SegmentDrawer} segments - The segment storage.
@param {Array.<string>} languages - The list of languages.
551022
function insertStaticSegments( components, segments, languages ) {

  for (var componentName in components) {
    if (components.hasOwnProperty( componentName )) {
      var language;
      var appliedTokens = [ ];
      var component = components[ componentName ];

      // Determine the language of the component.
      if (typeof languages === 'string')
        language = languages;
      else {
        var parts = componentName.split( '/', 2 );
        language = languages.indexOf( parts[ 0 ] ) >= 0 ? parts[ 0 ] : '';
      }

      // Insert static segments into a language specific component only.
      if (language) {
        // Get static segment tokens of the component.
        component.tokens.filter( function ( token ) {
          return token.isStatic;
        } )
          .forEach( function ( token ) {

            // Get segment.
            var segment = segments.get( language, token.name );

            // Insert the static segment into the component.
            var re = new RegExp( token.expression, 'g' );
            component.html = component.html.replace( re, segment.html );
            appliedTokens.push( token.name );
          } );

        // Remove applied segment tokens.
        component.tokens = component.tokens.filter( function ( token ) {
          return appliedTokens.indexOf( token.name ) < 0;
        } );
      }
    }
  }
}
409729
private void mergeReleasedEntries(Segment segment, Segment compactSegment) {
    for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
      if (!segment.isLive(i)) {
        compactSegment.release(i);
      }
    }
  }
474144
function(segment, previousSegment, nextSegment) {

            // insert after previous segment and before previous segment's next segment
            segment.previousSegment = previousSegment;
            segment.nextSegment = nextSegment;
            if (previousSegment) previousSegment.nextSegment = segment;
            if (nextSegment) nextSegment.previousSegment = segment;

            var updateSubpathStart = segment;
            if (segment.isSubpathStart) {
                segment.subpathStartSegment = segment; // assign self as subpath start segment
                updateSubpathStart = nextSegment; // start updating from next segment
            }

            // assign previous segment's subpath start (or self if it is a subpath start) to subsequent segments
            if (updateSubpathStart) this.updateSubpathStartSegment(updateSubpathStart);

            return segment;
        }
164190
public void addLanguages( Iterable<QueryParser> languages ) {
        CheckArg.isNotNull(languages, "languages");
        for (QueryParser language : languages) {
            addLanguage(language);
        }
    }
302647
def _prepPointsForSegments(points):
    
    while 1:
        point = points[-1]
        if point.segmentType:
            break
        else:
            point = points.pop()
            points.insert(0, point)
            continue
        break
982268
function sortSegmentRow(segments) {
		var sortedSegments = [];

		// build the subrow array
		var subrows = buildSegmentSubrows(segments);

		// flatten it
		for (var i=0; i<subrows.length; i++) {
			sortedSegments.push.apply(sortedSegments, subrows[i]); // append an array to an array
		}

		return sortedSegments;
	}
327590
protected void registerComponents(final ClassScanner componentScanner, final Class<?> scanningRoot) {
        componentScanners.add(new Pair<Class<?>, ClassScanner>(scanningRoot, componentScanner));
    }
862093
public void setComponents(java.util.Collection<ResourcePathComponent> components) {
        if (components == null) {
            this.components = null;
            return;
        }

        this.components = new java.util.ArrayList<ResourcePathComponent>(components);
    }
1075140
public function placeToSections(array $componentsBySections)
    {
        foreach ($componentsBySections as $section => $children) {
            if (!is_array($children)) {
                throw new InvalidArgumentException(
                    'Wrong argument format for Layout::placeToSections. Array of components for each section expected.'
                );
            }
            $this->section($section)->addChildren($children);
        }
        return $this;
    }
358655
public function setComponents(array $components)
    {
        foreach ($components as $id => $properties) {
            $this->setComponent($id, $properties);
        }
    }
963214
private void setComponents() {

        CmsUriSplitter splitter = new CmsUriSplitter(m_uri, true);
        m_target = splitter.getPrefix();
        m_anchor = CmsLinkProcessor.unescapeLink(splitter.getAnchor());
        setQuery(splitter.getQuery());
    }
1310211
public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalArgumentException {
		Assert.notNull(pathSegments, "'segments' must not be null");
		this.pathBuilder.addPathSegments(pathSegments);
		resetSchemeSpecificPart();
		return this;
	}
822707
private static void add(Polygon poly, int flag, ArrayList<SegmentString> segments) {
        add(poly.getExteriorRing(), flag, segments);
        for (int j = 0; j < poly.getNumInteriorRing(); j++) {
            add(poly.getInteriorRingN(j), flag, segments);
        }
    }
257159
public synchronized void replaceSegments(Collection<Segment> segments, Segment segment) {
    // Update the segment descriptor and lock the segment.
    segment.descriptor().update(System.currentTimeMillis());
    segment.descriptor().lock();

    // Iterate through old segments and remove them from the segments list.
    for (Segment oldSegment : segments) {
      if (!this.segments.containsKey(oldSegment.index())) {
        throw new IllegalArgumentException("unknown segment at index: " + oldSegment.index());
      }
      this.segments.remove(oldSegment.index());
    }

    // Put the new segment in the segments list.
    this.segments.put(segment.index(), segment);

    resetCurrentSegment();
  }
1074209
public void setSegmentList(int i, AnnotationSegment v) { 
    if (MMAXAnnotation_Type.featOkTst && ((MMAXAnnotation_Type)jcasType).casFeat_segmentList == null)
      jcasType.jcas.throwFeatMissing("segmentList", "de.julielab.jules.types.mmax.MMAXAnnotation");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((MMAXAnnotation_Type)jcasType).casFeatCode_segmentList), i);
    jcasType.ll_cas.ll_setRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((MMAXAnnotation_Type)jcasType).casFeatCode_segmentList), i, jcasType.ll_cas.ll_getFSRef(v));}
1144856
private void compactEntries(Segment segment, Segment compactSegment) {
    for (long i = segment.firstIndex(); i <= segment.lastIndex(); i++) {
      checkEntry(i, segment, compactSegment);
    }
  }
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());
    }