Package java.util

Examples of java.util.Map


   * BOM information from http://www.unicode.org/faq/utf_bom.html
   * @param args
   */
  public static void main(String[] args) {

    Map map = new LinkedHashMap();
    map.put("UTF-8", new byte[] { (byte) 0xEF, (byte) 0xbb, (byte) 0xbf, 'H',
        'i' });
    map.put("UTF-32 BE BOM", new byte[] { 0, 0, (byte) 0xFE, (byte) 0xFF, 'H',
        0, 0, 0, 'i', 0, 0, 0 });
    map.put("UTF-16 LE BOM", new byte[] { (byte) 0xFF, (byte) 0xFE, 'H', 0,
        'i', 0 });
    map.put("UTF-16 BE BOM", new byte[] { (byte) 0xFE, (byte) 0xFF, 0, 'H', 0,
        'i' });
    map.put("UTF-16 LE", new byte[] { 'H', 0, 'i', 0 });
    map.put("UTF-16 BE", new byte[] { 0, 'H', 0, 'i' });

    for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
      String element = (String) iterator.next();
      System.out.println(element + ":");
      byte[] buffer = (byte[]) map.get(element);

      boolean bFirst0 = buffer[0] == 0;
      boolean bSecond0 = buffer[1] == 0;
      String data = "";
      try {
View Full Code Here


      Debug.printStackTrace(e);
    }
    
      // one "plugin" can have multiple interfaces. We need to group by their id
   
    Map  pid_map = new HashMap();
   
    for(int i = 0 ; i < plugins.length ; i++){
     
        PluginInterface plugin = plugins[i];
               
        String  pid   = plugin.getPluginID();
       
        ArrayList  pis = (ArrayList)pid_map.get( pid );
       
        if ( pis == null ){
         
          pis = new ArrayList();
         
          pid_map.put( pid, pis );
        }
       
        pis.add( plugin );
    }
   
    ArrayList[]  pid_list = new ArrayList[pid_map.size()];
   
    pid_map.values().toArray( pid_list );
 
    Arrays.sort(
        pid_list,
        new Comparator()
      {
View Full Code Here

      ShareRatioItem.COLUMN_ID,
      TrackerStatusItem.COLUMN_ID,
    };

    TableColumnManager tcManager = TableColumnManager.getInstance();
    Map mapTCs = tcManager.getTableColumnsAsMap(DownloadTypeIncomplete.class, tableID);

    tcManager.setDefaultColumnNames(tableID, defaultVisibleOrder);

    if (!tcManager.loadTableColumnSettings(DownloadTypeIncomplete.class,
        tableID)
        || areNoneVisible(mapTCs)) {
      setVisibility(mapTCs, defaultVisibleOrder);
      RankItem tc = (RankItem) mapTCs.get(RankItem.COLUMN_ID);
      if (tc != null) {
        tcManager.setDefaultSortColumnName(tableID, RankItem.COLUMN_ID);
        tc.setSortAscending(true);
      }
    }

    return (TableColumnCore[]) mapTCs.values().toArray(new TableColumnCore[0]);
  }
View Full Code Here

      UpItem.COLUMN_ID,
      TrackerStatusItem.COLUMN_ID,
    };

    TableColumnManager tcManager = TableColumnManager.getInstance();
    Map mapTCs = tcManager.getTableColumnsAsMap(DownloadTypeComplete.class, tableID);

    tcManager.setDefaultColumnNames(tableID, defaultVisibleOrder);

    if (!tcManager.loadTableColumnSettings(DownloadTypeComplete.class,
        tableID)
        || areNoneVisible(mapTCs)) {
      setVisibility(mapTCs, defaultVisibleOrder);

      RankItem tc = (RankItem) mapTCs.get(RankItem.COLUMN_ID);
      if (tc != null) {
        tcManager.setDefaultSortColumnName(tableID, RankItem.COLUMN_ID);
        tc.setSortAscending(true);
      }
    }

    return (TableColumnCore[]) mapTCs.values().toArray(new TableColumnCore[0]);
  }
View Full Code Here

    // Call plugin listeners
    UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (uiFunctions != null) {
      UISWTInstanceImpl pluginUI = uiFunctions.getSWTPluginInstanceImpl();
      Map pluginViews = pluginUI == null ? null
          : pluginUI.getViewListeners(UISWTInstance.VIEW_MYTORRENTS);
      if (pluginViews != null) {
        String[] sNames = (String[]) pluginViews.keySet().toArray(new String[0]);
        for (int i = 0; i < sNames.length; i++) {
          UISWTViewEventListener l = (UISWTViewEventListener) pluginViews.get(sNames[i]);
          if (l != null) {
            try {
              UISWTViewImpl view = new UISWTViewImpl(
                  UISWTInstance.VIEW_MYTORRENTS, sNames[i], l);
              addSection(view);
View Full Code Here

         }

      if (_wizard.useWebSeed && _wizard.webseeds.size() > 0 ){
          this.reportCurrentTask(MessageText.getString("wizard.webseed.adding"));
         
          Map  ws = _wizard.webseeds;
         
          List  getright = (List)ws.get( "getright" );
         
          if ( getright.size() > 0 ){
         
            for (int i=0;i<getright.size();i++){
              reportCurrentTask( "    GetRight: " + getright.get(i));
            }
            torrent.setAdditionalListProperty( "url-list", new ArrayList( getright ));
          }
         
          List  webseed = (List)ws.get( "webseed" );
         
          if ( webseed.size() > 0 ){
         
            for (int i=0;i<webseed.size();i++){
              reportCurrentTask( "    WebSeed: " + webseed.get(i));
View Full Code Here

        // fall through and end up in error
      }
      }
      else if (type.isAssignableFrom(Map.class)) {
        List<String> l = Arrays.asList(value.split(",")); //$NON-NLS-1$
        Map m = new HashMap<String, String>();
        for(String key: l) {
          int index = key.indexOf('=');
          if (index != -1) {
            m.put(key.substring(0, index), key.substring(index+1));
          }
        }
        return (T)m;
      }
View Full Code Here

    if (index != -1) {
      String uuid = id.substring(0, index);
      int row = Integer.parseInt(id.substring(index+1));
      TupleBuffer tb = this.bufferMgr.getTupleBuffer(uuid);
      if (tb != null) {
        Map map = new HashMap();
        TupleBatch b = tb.getBatch(row);
        b.preserveTypes();
        map.put(id, b);
        return map;
      }
      return super.get(fqn);
    }
    return null;
View Full Code Here

            Arrays.asList(new Object[] { new Integer(0) })                     
        };
       
        FakeDataManager dataMgr = new FakeDataManager();
        dataMgr.setThrowBlocked(true);
        Map valueMap = new HashMap();
        valueMap.put(new Integer(0), new Integer(1));
        valueMap.put(new Integer(1), new Integer(2));
        dataMgr.defineCodeTable("pm1.g1", "e1", "e2", valueMap); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

        helpTestSelect(elements, crit, data, childElements, dataMgr, expected);

    }   
View Full Code Here

       
        NodeEditor.removeChildNode(joinNode, nullNode);
        NodeEditor.removeChildNode(joinNode.getParent(), joinNode);
       
        for (GroupSymbol group : nullNode.getGroups()) {
            Map nullSymbolMap = FrameUtil.buildSymbolMap(group, null, metadata);
            FrameUtil.convertFrame(frameStart, group, null, nullSymbolMap, metadata);
        }
       
    }   
View Full Code Here

TOP

Related Classes of java.util.Map

Copyright © 2015 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.