001/* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil; coding: utf-8-unix -*- 002 * 003 * Copyright © 2024–2026 microBean™. 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 006 * the License. You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 011 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 012 * specific language governing permissions and limitations under the License. 013 */ 014package org.microbean.construct; 015 016import java.util.concurrent.locks.ReentrantLock; 017 018/** 019 * A class holding a {@link ReentrantLock} that should be used to serialize <dfn>symbol completion</dfn> and <dfn>name 020 * expansion</dfn>. 021 * 022 * <p>Most users should simply {@linkplain DefaultDomain#DefaultDomain() use an appropriate <code>DefaultDomain</code>} 023 * instead of working directly with instances of this class.</p> 024 * 025 * @author <a href="https://about.me/lairdnelson" target="_top">Laird Nelson</a> 026 * 027 * @see #INSTANCE 028 * 029 * @see Domain#lock() 030 * 031 * @see Domain#toString(CharSequence) 032 * 033 * @see DefaultDomain#DefaultDomain() 034 */ 035public final class SymbolCompletionLock { 036 037 /** 038 * A non-{@code null} {@link ReentrantLock} that should be used to serialize symbol completion and name expansion. 039 * 040 * @see Domain#lock() 041 */ 042 public static final ReentrantLock INSTANCE = new ReentrantLock(); 043 044 private SymbolCompletionLock() { 045 super(); 046 } 047 048}