/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Abstract base class for charset providers.
*
* @author Mark Reinhold
*/
public class AbstractCharsetProvider
extends CharsetProvider
{
/* Maps canonical names to class names
*/
/* Maps alias names to canonical names
*/
/* Maps canonical names to alias-name arrays
*/
/* Maps canonical names to soft references that hold cached instances
*/
protected AbstractCharsetProvider() {
packagePrefix = "sun.nio.cs";
}
}
/* Add an entry to the given map, but only if no mapping yet exists
* for the given name.
*/
if (!m.containsKey(name))
}
assert (x != null);
}
/* Declare support for the given charset
*/
synchronized (this) {
}
}
synchronized (this) {
}
}
/* Late initialization hook, needed by some providers
*/
protected void init() { }
}
// Check cache first
return cs;
}
// Do we even support this charset?
return null;
// Instantiate the charset and cache it
try {
true,
this.getClass().getClassLoader());
return cs;
} catch (ClassNotFoundException x) {
return null;
} catch (IllegalAccessException x) {
return null;
} catch (InstantiationException x) {
return null;
}
}
synchronized (this) {
init();
}
}
synchronized (this) {
init();
}
public boolean hasNext() {
return i.hasNext();
}
synchronized (AbstractCharsetProvider.this) {
}
}
public void remove() {
throw new UnsupportedOperationException();
}
};
}
synchronized (this) {
init();
}
}
}