1/*
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
3 */
4/*
5 * Licensed to the Apache Software Foundation (ASF) under one or more
6 * contributor license agreements.  See the NOTICE file distributed with
7 * this work for additional information regarding copyright ownership.
8 * The ASF licenses this file to You under the Apache License, Version 2.0
9 * (the "License"); you may not use this file except in compliance with
10 * the License.  You may obtain a copy of the License at
11 *
12 *      http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20package com.sun.org.apache.xerces.internal.dom;
21
22
23/** Internal class LCount is used to track the number of
24    listeners registered for a given event name, as an entry
25    in a global Map. This should allow us to avoid generating,
26    or discarding, events for which no listeners are registered.
27
28    ***** There should undoubtedly be methods here to manipulate
29    this table. At the moment that code's residing in NodeImpl.
30    Move it when we have a chance to do so. Sorry; we were
31    rushed.
32*/
33/**
34 * @xerces.internal
35 *
36 */
37
38class LCount
39{
40    static final java.util.Map<String, LCount> lCounts=new java.util.concurrent.ConcurrentHashMap<>();
41    public int captures=0,bubbles=0,defaults, total=0;
42
43    static LCount lookup(String evtName)
44    {
45        return lCounts.computeIfAbsent(evtName, (key) -> new LCount());
46    }
47} // class LCount
48