當前位置: 首頁>>代碼示例>>Java>>正文


Java Hashtable.values方法代碼示例

本文整理匯總了Java中java.util.Hashtable.values方法的典型用法代碼示例。如果您正苦於以下問題:Java Hashtable.values方法的具體用法?Java Hashtable.values怎麽用?Java Hashtable.values使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.util.Hashtable的用法示例。


在下文中一共展示了Hashtable.values方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCreatedFonts

import java.util.Hashtable; //導入方法依賴的package包/類
public Font[] getCreatedFonts() {

        Hashtable<String,Font2D> nameTable;
        if (fontsAreRegistered) {
            nameTable = createdByFullName;
        } else if (fontsAreRegisteredPerAppContext) {
            AppContext appContext = AppContext.getAppContext();
            nameTable =
                (Hashtable<String,Font2D>)appContext.get(regFullNameKey);
        } else {
            return null;
        }

        Locale l = getSystemStartupLocale();
        synchronized (nameTable) {
            Font[] fonts = new Font[nameTable.size()];
            int i=0;
            for (Font2D font2D : nameTable.values()) {
                fonts[i++] = new Font(font2D.getFontName(l), Font.PLAIN, 1);
            }
            return fonts;
        }
    }
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:24,代碼來源:SunFontManager.java

示例2: distFeaturesOnClients

import java.util.Hashtable; //導入方法依賴的package包/類
public int[] distFeaturesOnClients() {
    Hashtable<SGHFeature, Integer> count = new Hashtable<SGHFeature, Integer>();
    for (SGHClientApp c : clients) {
        for (SGHFeature f : c.featureSet) {
            if (!count.containsKey(f)) {
                count.put(f, 1);
            }
            else {
                count.put(f, count.get(f) + 1);
            }
        }
    }
    ArrayList<Integer> counts = new ArrayList<Integer>(count.values());
    Collections.sort(counts);
    int[] result = new int[counts.size()];
    for (int i=0; i<counts.size(); i++) result[counts.size()-i-1] = counts.get(i);
    return result;
}
 
開發者ID:ffleurey,項目名稱:EvoServ,代碼行數:19,代碼來源:SGHSystem.java

示例3: distFeaturesOnServers

import java.util.Hashtable; //導入方法依賴的package包/類
public int[] distFeaturesOnServers() {
    Hashtable<SGHFeature, Integer> count = new Hashtable<SGHFeature, Integer>();
    for (SGHServer s : servers) {
        for (SGHFeature f : s.featureSet) {
            if (!count.containsKey(f)) {
                count.put(f, 1);
            }
            else {
                count.put(f, count.get(f) + 1);
            }
        }
    }
    ArrayList<Integer> counts = new ArrayList<Integer>(count.values());
    Collections.sort(counts);
    int[] result = new int[counts.size()];
    for (int i=0; i<counts.size(); i++) result[counts.size()-i-1] = counts.get(i);
    return result;
}
 
開發者ID:ffleurey,項目名稱:EvoServ,代碼行數:19,代碼來源:SGHSystem.java

示例4: getCreatedFontFamilyNames

import java.util.Hashtable; //導入方法依賴的package包/類
public TreeMap<String, String> getCreatedFontFamilyNames() {

        Hashtable<String,FontFamily> familyTable;
        if (fontsAreRegistered) {
            familyTable = createdByFamilyName;
        } else if (fontsAreRegisteredPerAppContext) {
            AppContext appContext = AppContext.getAppContext();
            @SuppressWarnings("unchecked")
            Hashtable<String,FontFamily> tmp =
                (Hashtable<String,FontFamily>)appContext.get(regFamilyKey);
            familyTable = tmp;
        } else {
            return null;
        }

        Locale l = getSystemStartupLocale();
        synchronized (familyTable) {
            TreeMap<String, String> map = new TreeMap<String, String>();
            for (FontFamily f : familyTable.values()) {
                Font2D font2D = f.getFont(Font.PLAIN);
                if (font2D == null) {
                    font2D = f.getClosestStyle(Font.PLAIN);
                }
                String name = font2D.getFamilyName(l);
                map.put(name.toLowerCase(l), name);
            }
            return map;
        }
    }
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:30,代碼來源:SunFontManager.java

示例5: getCreatedFonts

import java.util.Hashtable; //導入方法依賴的package包/類
public Font[] getCreatedFonts() {

        Hashtable<String,Font2D> nameTable;
        if (fontsAreRegistered) {
            nameTable = createdByFullName;
        } else if (fontsAreRegisteredPerAppContext) {
            AppContext appContext = AppContext.getAppContext();
            @SuppressWarnings("unchecked")
            Hashtable<String,Font2D> tmp =
                (Hashtable<String,Font2D>)appContext.get(regFullNameKey);
            nameTable = tmp;
        } else {
            return null;
        }

        Locale l = getSystemStartupLocale();
        synchronized (nameTable) {
            Font[] fonts = new Font[nameTable.size()];
            int i=0;
            for (Font2D font2D : nameTable.values()) {
                fonts[i++] = new Font(font2D.getFontName(l), Font.PLAIN, 1);
            }
            return fonts;
        }
    }
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:26,代碼來源:SunFontManager.java

示例6: dispose

import java.util.Hashtable; //導入方法依賴的package包/類
/**
 * Unbinds all character pixmaps of this font.
 */
public void dispose() 
{
	Hashtable<ITexture, ITexture> set = new Hashtable<ITexture, ITexture>();
	
	for(Pixmap p: texHashMap.values())
		set.put(p.getTexture(), p.getTexture());
	
	for(ITexture t: set.values())
		t.dispose();
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:14,代碼來源:Font.java

示例7: main

import java.util.Hashtable; //導入方法依賴的package包/類
public static void main(String[] args) {

    //create Hashtable object
    Hashtable ht = new Hashtable();

    //add key value pairs to Hashtable
    ht.put("1", "One");
    ht.put("2", "Two");
    ht.put("3", "Three");

    /*
      get Collection of values contained in Hashtable using
      Collection values() method of Hashtable class
    */

    Collection c = ht.values();

    System.out.println("Values of Collection created from Hashtable are :");
    //iterate through the collection
    Iterator itr = c.iterator();
    while (itr.hasNext()) System.out.println(itr.next());

    /*
       Please note that resultant Collection object is backed by the Hashtable.
       Any value that is removed from Collection will also be removed from
       original Hashtable object. The same is not the case with the element
       addition.
    */

    //remove One from collection
    c.remove("One");

    //print values of original values of Hashtable
    System.out.println("Hashtable values after removal from Collection are :");
    Enumeration e = ht.elements();
    while (e.hasMoreElements()) System.out.println(e.nextElement());
  }
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:38,代碼來源:GetCollectionOfValuesFromHashtableExample.java

示例8: getCreatedFontFamilyNames

import java.util.Hashtable; //導入方法依賴的package包/類
public TreeMap<String, String> getCreatedFontFamilyNames() {

        Hashtable<String,FontFamily> familyTable;
        if (fontsAreRegistered) {
            familyTable = createdByFamilyName;
        } else if (fontsAreRegisteredPerAppContext) {
            AppContext appContext = AppContext.getAppContext();
            familyTable =
                (Hashtable<String,FontFamily>)appContext.get(regFamilyKey);
        } else {
            return null;
        }

        Locale l = getSystemStartupLocale();
        synchronized (familyTable) {
            TreeMap<String, String> map = new TreeMap<String, String>();
            for (FontFamily f : familyTable.values()) {
                Font2D font2D = f.getFont(Font.PLAIN);
                if (font2D == null) {
                    font2D = f.getClosestStyle(Font.PLAIN);
                }
                String name = font2D.getFamilyName(l);
                map.put(name.toLowerCase(l), name);
            }
            return map;
        }
    }
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:28,代碼來源:SunFontManager.java

示例9: buildMovieFromCursor

import java.util.Hashtable; //導入方法依賴的package包/類
public static List<MovieTags> buildMovieFromCursor(Cursor cur) {
    Hashtable<Long, MovieTags> tags = new Hashtable<Long, MovieTags>();
    if(DBG) Log.d(TAG, "Building MovieTags from Cursor");
    if(!cur.moveToFirst())
        return null;
    do {
        Long id = Long.valueOf(getLongCol(cur, ScraperStore.Movie.ID));
        String name = getStringCol(cur, ScraperStore.Movie.NAME);
        float rating = getFloatCol(cur, ScraperStore.Movie.RATING);
        int year = getIntCol(cur, ScraperStore.Movie.YEAR);
        String plot = getStringCol(cur, ScraperStore.Movie.PLOT);
        String cover = getStringCol(cur, ScraperStore.Movie.COVER);
        String actorName = getStringCol(cur, ScraperStore.Movie.Actor.NAME);
        String role = getStringCol(cur, ScraperStore.Movie.Actor.ROLE);
        String director = getStringCol(cur, ScraperStore.Movie.Director.NAME);
        String genre = getStringCol(cur, ScraperStore.Movie.Genre.NAME);
        String studio = getStringCol(cur, ScraperStore.Movie.Studio.NAME);

        String backdropUrl = getStringCol(cur, ScraperStore.Movie.BACKDROP_URL);
        String backdropPath = getStringCol(cur, ScraperStore.Movie.BACKDROP);

        MovieTags tag = tags.get(id);
        if(tag == null) {
            tag = new MovieTags();
            tags.put(id, tag);
        }
        tag.setId(id.longValue());
        tag.setTitle(name);
        if(rating >= 0)
            tag.setRating(rating);
        if(year >= 0)
            tag.setYear(year);
        tag.setPlot(plot);

        if(cover != null)
            tag.setCover(new File(cover));

        tag.addActorIfAbsent(actorName, role);
        tag.addDirectorIfAbsent(director);
        tag.addGenreIfAbsent(genre);
        tag.addStudioIfAbsent(studio);

        if(backdropUrl != null && backdropPath != null) {
            ScraperImage image = new ScraperImage(Type.MOVIE_BACKDROP, null);
            image.setLargeUrl(backdropUrl);
            image.setLargeFile(backdropPath);
            tag.setBackdrops(image.asList());
        }

    } while(cur.moveToNext());
    return new ArrayList<MovieTags>(tags.values());
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:53,代碼來源:TagsFactory.java

示例10: buildShowFromCursor

import java.util.Hashtable; //導入方法依賴的package包/類
public static List<ShowTags> buildShowFromCursor(Cursor cur) {
    Hashtable<Long, ShowTags> tags = new Hashtable<Long, ShowTags>();
    if(DBG) Log.d(TAG, "Building ShowTags from Cursor");
    if(!cur.moveToFirst())
        return null;
    do {
        Long id = Long.valueOf(getLongCol(cur, ScraperStore.Show.ID));
        String name = getStringCol(cur, ScraperStore.Show.NAME);
        float rating = getFloatCol(cur, ScraperStore.Show.RATING);
        long premiered = getLongCol(cur, ScraperStore.Show.PREMIERED);
        String plot = getStringCol(cur, ScraperStore.Show.PLOT);
        String cover = getStringCol(cur, ScraperStore.Show.COVER);
        String actorName = getStringCol(cur, ScraperStore.Show.Actor.NAME);
        String role = getStringCol(cur, ScraperStore.Show.Actor.ROLE);
        String director = getStringCol(cur, ScraperStore.Show.Director.NAME);
        String genre = getStringCol(cur, ScraperStore.Show.Genre.NAME);
        String studio = getStringCol(cur, ScraperStore.Show.Studio.NAME);

        String backdropUrl = getStringCol(cur, ScraperStore.Show.BACKDROP_URL);
        String backdropPath = getStringCol(cur, ScraperStore.Show.BACKDROP);

        ShowTags tag = tags.get(id);
        if(tag == null) {
            tag = new ShowTags();
            tags.put(id, tag);
        }
        tag.setTitle(name);
        tag.setId(id.longValue());
        if(rating >= 0)
            tag.setRating(rating);
        if(premiered >= 0)
            tag.setPremiered(premiered);
        tag.setPlot(plot);

        if(cover != null)
            tag.setCover(new File(cover));

        tag.addActorIfAbsent(actorName, role);
        tag.addDirectorIfAbsent(director);
        tag.addGenreIfAbsent(genre);
        tag.addStudioIfAbsent(studio);

        if(backdropUrl != null && backdropPath != null) {
            ScraperImage image = new ScraperImage(Type.SHOW_BACKDROP, null);
            image.setLargeUrl(backdropUrl);
            image.setLargeFile(backdropPath);
            tag.setBackdrops(image.asList());
        }
    } while(cur.moveToNext());
    return new ArrayList<ShowTags>(tags.values());
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:52,代碼來源:TagsFactory.java

示例11: buildEpisodeFromCursor

import java.util.Hashtable; //導入方法依賴的package包/類
public static List<EpisodeTags> buildEpisodeFromCursor(Cursor cur) {
    Hashtable<Long, EpisodeTags> tags = new Hashtable<Long, EpisodeTags>();
    if(DBG) Log.d(TAG, "Building MovieTags from Cursor");
    if(!cur.moveToFirst())
        return null;
    do {
        Long id = Long.valueOf(getLongCol(cur, ScraperStore.Episode.ID));
        String name = getStringCol(cur, ScraperStore.Episode.NAME);
        float rating = getFloatCol(cur, ScraperStore.Episode.RATING);
        long aired = getLongCol(cur, ScraperStore.Episode.AIRED);
        String plot = getStringCol(cur, ScraperStore.Episode.PLOT);
        int season = getIntCol(cur, ScraperStore.Episode.SEASON);
        int number = getIntCol(cur, ScraperStore.Episode.NUMBER);
        long show = getLongCol(cur, ScraperStore.Episode.SHOW);
        String actorName = getStringCol(cur, ScraperStore.Episode.Actor.NAME);
        String role = getStringCol(cur, ScraperStore.Episode.Actor.ROLE);
        String director = getStringCol(cur, ScraperStore.Episode.Director.NAME);
        String cover = getStringCol(cur, ScraperStore.Episode.COVER);

        EpisodeTags tag = tags.get(id);
        if(tag == null) {
            tag = new EpisodeTags();
            tags.put(id, tag);
        }
        tag.setId(id.longValue());
        tag.setTitle(name);
        if(rating >= 0)
            tag.setRating(rating);
        if(aired >= 0)
            tag.setAired(aired);
        tag.setPlot(plot);
        tag.setSeason(season);
        tag.setEpisode(number);
        tag.setShowId(show);
        tag.addActorIfAbsent(actorName, role);
        tag.addDirectorIfAbsent(director);

        if(cover != null)
            tag.setCover(new File(cover));

    } while(cur.moveToNext());
    return new ArrayList<EpisodeTags>(tags.values());
}
 
開發者ID:archos-sa,項目名稱:aos-MediaLib,代碼行數:44,代碼來源:TagsFactory.java


注:本文中的java.util.Hashtable.values方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。