Freezes the collator.
@return the collator itself.
971359
@Override
    public Collator freeze() {
        if (!isFrozen()) {
            frozenLock = new ReentrantLock();
            if (collationBuffer == null) {
                collationBuffer = new CollationBuffer(data);
            }
        }
        return this;
    }
291212
public static final Parser<Integer> instance() { // NOPMD it's thread save!
    if (IntegerParserWithoutSeparator.instanceParser == null) {
      synchronized (IntegerParserWithoutSeparator.class) {
        if (IntegerParserWithoutSeparator.instanceParser == null) {
          IntegerParserWithoutSeparator.instanceParser = new IntegerParserWithoutSeparator();
        }
      }
    }
    return IntegerParserWithoutSeparator.instanceParser;
  }
1267605
public static <E> MutableObjectIterator<E> get() {
		@SuppressWarnings("unchecked")
		MutableObjectIterator<E> iter = (MutableObjectIterator<E>) INSTANCE;
		return iter;
	}
1783
private function doTransitionFromC() : self
    {
        if ($this->getToken() === Grammar::T_X) {
            if ($this->hasToken(1) && $this->getToken(1) === Grammar::T_X) {
                if ($this->hasToken(2) && $this->getToken(2) === Grammar::T_X) {
                    $this
                        ->setState(self::STATE_B)
                        ->addPosition(3)
                        ->addTokenValue(Grammar::T_X, null, 3);
                    return $this;
                }

                $this
                    ->setState(self::STATE_B)
                    ->addPosition(2)
                    ->addTokenValue(Grammar::T_X, null, 2);
                return $this;
            }

            $this
                ->setState(self::STATE_B)
                ->addPosition(1)
                ->addTokenValue(Grammar::T_X);
            return $this;
        }

        $this->setState(self::STATE_B);
        return $this;
    }
1187623
public Iterator<Writable> iterator() {
    final TupleWritable t = this;
    return new Iterator<Writable>() {
      long i = written;
      long last = 0L;
      public boolean hasNext() {
        return 0L != i;
      }
      public Writable next() {
        last = Long.lowestOneBit(i);
        if (0 == last)
          throw new NoSuchElementException();
        i ^= last;
        // numberOfTrailingZeros rtn 64 if lsb set
        return t.get(Long.numberOfTrailingZeros(last) % 64);
      }
      public void remove() {
        t.written ^= last;
        if (t.has(Long.numberOfTrailingZeros(last))) {
          throw new IllegalStateException("Attempt to remove non-existent val");
        }
      }
    };
  }
705572
static <T> Collection<T> freeze(Collection<T> coll) {
        return coll == null ? null : Collections.unmodifiableCollection(coll);
    }
687625
@Override
    public final Iterator<T> iterator() {
        synchronized (this.state) {
            checkState();
            this.state.available = false;
            final Iterator<T> iterator;
            try {
                iterator = new CheckedIterator<T>(doIterator(), this);
            } catch (final Throwable ex) {
                throw Throwables.propagate(ex);
            }
            this.state.activeIterator = iterator;
            return iterator;
        }
    }
289404
public char getStopKey() {
        String value = Optional.fromNullable(getParameter(SignalParameters.STOP_KEY.symbol())).or("");
        return value.isEmpty() ? ' ' : value.charAt(0);
    }
492374
@SuppressWarnings("NullableProblems")
  @Override
  public Iterator<T> iterator() {
    return new Iterator<T>() {
      private int index = 0;

      @Override
      public boolean hasNext() {
        return this.index < size();
      }

      @Override
      public T next() {
        if (this.index >= size()) {
          throw new NoSuchElementException(this.index + ">=" + size());
        }
        return getElementAt(this.index++);
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("Removing is unsupported here");
      }

    };
  }
252627
public EventResultDisruptor waitForBlocking() {
		SequenceBarrier barrier = ringBuffer.newBarrier();
		try {
			long a = barrier.waitFor(waitAtSequence);
			if (ringBuffer != null)
				return ringBuffer.get(a);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			barrier.alert();
		}
		return null;
	}
1118902
public final String state() {

        String thisMethodName = "state";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
        }

        String state = getState();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, state);
        }

        return state;
    }
596512
public synchronized T get ()
    {
        while (_count == 0) {
            try { wait(); } catch (InterruptedException e) {}
        }

        // pull the object off, and clear our reference to it
        T retval = _items[_start];
        _items[_start] = null;

        _start = (_start + 1) % _size;
        _count--;

        // if we are only filling 1/8th of the space, shrink by half
        if ((_size > MIN_SHRINK_SIZE) && (_size > _suggestedSize) &&
            (_count < (_size >> 3))) shrink();

        return retval;
    }
1161607
public void freeze() {
        /* Construct the rule array and index table.  We reorder the
         * rules by sorting them into 256 bins.  Each bin contains all
         * rules matching the index value for that bin.  A rule
         * matches an index value if string whose first key character
         * has a low byte equal to the index value can match the rule.
         *
         * Each bin contains zero or more rules, in the same order
         * they were found originally.  However, the total rules in
         * the bins may exceed the number in the original vector,
         * since rules that have a variable as their first key
         * character will generally fall into more than one bin.
         *
         * That is, each bin contains all rules that either have that
         * first index value as their first key character, or have
         * a set containing the index value as their first character.
         */
        int n = ruleVector.size();
        index = new int[257]; // [sic]
        List<TransliterationRule> v = new ArrayList<TransliterationRule>(2*n); // heuristic; adjust as needed

        /* Precompute the index values.  This saves a LOT of time.
         */
        int[] indexValue = new int[n];
        for (int j=0; j<n; ++j) {
            TransliterationRule r = ruleVector.get(j);
            indexValue[j] = r.getIndexValue();
        }
        for (int x=0; x<256; ++x) {
            index[x] = v.size();
            for (int j=0; j<n; ++j) {
                if (indexValue[j] >= 0) {
                    if (indexValue[j] == x) {
                        v.add(ruleVector.get(j));
                    }
                } else {
                    // If the indexValue is < 0, then the first key character is
                    // a set, and we must use the more time-consuming
                    // matchesIndexValue check.  In practice this happens
                    // rarely, so we seldom tread this code path.
                    TransliterationRule r = ruleVector.get(j);
                    if (r.matchesIndexValue(x)) {
                        v.add(r);
                    }
                }
            }
        }
        index[256] = v.size();

        /* Freeze things into an array.
         */
        rules = new TransliterationRule[v.size()];
        v.toArray(rules);

        StringBuilder errors = null;

        /* Check for masking.  This is MUCH faster than our old check,
         * which was each rule against each following rule, since we
         * only have to check for masking within each bin now.  It's
         * 256*O(n2^2) instead of O(n1^2), where n1 is the total rule
         * count, and n2 is the per-bin rule count.  But n2<<n1, so
         * it's a big win.
         */
        for (int x=0; x<256; ++x) {
            for (int j=index[x]; j<index[x+1]-1; ++j) {
                TransliterationRule r1 = rules[j];
                for (int k=j+1; k<index[x+1]; ++k) {
                    TransliterationRule r2 = rules[k];
                    if (r1.masks(r2)) {
                        if (errors == null) {
                            errors = new StringBuilder();
                        } else {
                            errors.append("\n");
                        }
                        errors.append("Rule " + r1 + " masks " + r2);
                    }
                }
            }
        }

        if (errors != null) {
            throw new IllegalArgumentException(errors.toString());
        }
    }
736757
public SkippableIterator getSkippableIterator() {
		return new SkippableIterator() {
			int pos = 0;
			int p = 0;

			public SkippableIterator init() {
				this.p = SparseBitmap.this.buffer.get(0);
				return this;
			}

			@Override
			public void advance() {
				this.pos += 2;
				if (this.pos < SparseBitmap.this.buffer.size())
					this.p += SparseBitmap.this.buffer.get(this.pos) + 1;
			}

			@Override
			public void advanceUntil(int min) {
				advance();
				while (hasValue() && (getCurrentWordOffset() < min)) {
					advance();
				}
			}

			@Override
			public int getCurrentWord() {
				return SparseBitmap.this.buffer.get(this.pos + 1);
			}

			@Override
			public int getCurrentWordOffset() {
				return this.p;
			}

			@Override
			public boolean hasValue() {
				return this.pos < SparseBitmap.this.buffer.size();
			}
		}.init();

	}
235062
public function freeze() {
        if (!$this->configured) {
            foreach ($this->mappings['paths'] as $mapping) {
                $mapping->freeze();             // no need to freeze named mappings as all have a path property
            }
            foreach ($this->tiles as $i => $tile) {
                if ($tile->isAbstract()) unset($this->tiles[$i]);
                else                     $tile->freeze();
            }
            $this->configured = true;
        }
        return $this;
    }
240118
public Iterator<Symbol> iterator() {
        return scope.getSymbols(t -> !unwanted(t), NON_RECURSIVE).iterator();
    }
912928
public static HyphenatorBuilder getInstance() {

    if (instance == null) {
      synchronized (HyphenatorBuilderImpl.class) {
        if (instance == null) {
          HyphenatorBuilderImpl impl = new HyphenatorBuilderImpl();
          impl.initialize();
          instance = impl;
        }
      }
    }
    return instance;
  }