Package com.lightcrafts.mediax.jai.util

Examples of com.lightcrafts.mediax.jai.util.CaselessStringKey


        new Object[] {modeName}));
  }

  // Update structures to reflect removal of this pref.
  Hashtable dht = (Hashtable)prefs.get(
      new CaselessStringKey(descriptorName));

  if (dht != null)
      dht.remove(new CaselessStringKey(productName));
    }
View Full Code Here


      Enumeration keys = instancesByName.keys();

      while (keys.hasMoreElements()) {
    Object instance = keys.nextElement();
    CaselessStringKey fileName =
        (CaselessStringKey)instancesByName.get(instance);

    Vector v = (Vector)instances.get(fileName);

    String dn = (String)v.get(2);
    String pn = (String)v.get(1);

    if (descriptorName.equalsIgnoreCase(dn) &&
           productName.equalsIgnoreCase(pn))
        list.add(instance);
      }

      return list;

  } else {
      Object obj =
    instances.get(new CaselessStringKey(descriptorName));
     
      ArrayList list = new ArrayList(1);

      list.add(obj);
      return list;
View Full Code Here

    /**
     * Get the local name of a factoryInstance
     */
    String getLocalName(Object factoryInstance) {
  CaselessStringKey fileName =
      (CaselessStringKey)instancesByName.get(factoryInstance);

  if (fileName != null)
      return fileName.getName();

  return null;
    }
View Full Code Here

      if (productName == null)
    throw new IllegalArgumentException(
        "productName : " + JaiI18N.getString("Generic0"));

      CaselessStringKey fileName =
    (CaselessStringKey)instancesByName.get(factoryInstance);

      if (fileName != null) {

    Vector v = (Vector)instances.get(fileName);

    String pn = (String)v.get(1);
    String dn = (String)v.get(2);

    if ((dn != null) && dn.equalsIgnoreCase(descriptorName) &&
        (pn != null) && pn.equalsIgnoreCase(productName)) {
        return;
    }
      }

      throw new IllegalArgumentException(
    JaiI18N.formatMsg("FactoryCache3",
        new Object[] { factoryInstance.getClass().getName(),
           descriptorName, productName}));
  } else {

      CaselessStringKey key = new CaselessStringKey(descriptorName);

      if (factoryInstance != instances.get(key)) {
    throw new IllegalArgumentException(
        JaiI18N.formatMsg("FactoryCache4",
      new Object[] { factoryInstance.getClass().getName(),
View Full Code Here

            Set nameSet = new HashSet((localNames.length+sourceNames.length)/2);

            // Add source names first as they have lower priority.
            int numSourceNames = sourceNames.length;
            for(int i = 0; i < numSourceNames; i++) {
                nameSet.add(new CaselessStringKey(sourceNames[i]));
            }

            // Add local names which will "bump" duplicate source names.
            int numLocalNames = localNames.length;
            for(int i = 0; i < numLocalNames; i++) {
                nameSet.add(new CaselessStringKey(localNames[i]));
            }

            // Convert result to an array of Strings.
            int numNames = nameSet.size();
            CaselessStringKey[] caselessNames = new CaselessStringKey[numNames];
View Full Code Here

     * mode. If it does not exist but the mode is a valid registry mode
     * then silently create one.
     */
    private FactoryCache getFactoryCache(String modeName) {

  CaselessStringKey key = new CaselessStringKey(modeName);

  FactoryCache fc = (FactoryCache)factories.get(key);

  if (fc == null) {

View Full Code Here

     * mode. If it does not exist but the mode is a valid registry mode
     * then silently create one.
     */
    private DescriptorCache getDescriptorCache(String modeName) {

  CaselessStringKey key = new CaselessStringKey(modeName);

  DescriptorCache dc = (DescriptorCache)descriptors.get(key);

  if (dc == null) {

View Full Code Here

     * @since JAI 1.1
     */
    public void removeRegistryMode(String modeName) {

  if (getDescriptorCache(modeName) != null)
      descriptors.remove(new CaselessStringKey(modeName));

  if (getFactoryCache(modeName) != null)
      factories.remove(new CaselessStringKey(modeName));
    }
View Full Code Here

  Enumeration e = descriptors.keys();
  int size = descriptors.size();
  String names[] = new String[size];

  for (int i = 0; i < size; i++) {
      CaselessStringKey key = (CaselessStringKey)e.nextElement();
      names[i] = key.getName();
  }

  return names;
    }
View Full Code Here

     *         by JAI or because the mode was not previously add.
     *         returns true otherwise.
     */
    public synchronized static boolean removeMode(String name) {

  CaselessStringKey key = new CaselessStringKey(name);

  if (immutableNames.contains(key))
      return false;

  return registryModes.remove(key) != null;
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.util.CaselessStringKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.