当前位置: 首页>>代码示例>>Java>>正文


Java Hashtable.putAll方法代码示例

本文整理汇总了Java中java.util.Hashtable.putAll方法的典型用法代码示例。如果您正苦于以下问题:Java Hashtable.putAll方法的具体用法?Java Hashtable.putAll怎么用?Java Hashtable.putAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.util.Hashtable的用法示例。


在下文中一共展示了Hashtable.putAll方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAssignmentTable

import java.util.Hashtable; //导入方法依赖的package包/类
public Hashtable getAssignmentTable(Collection classesOrClassIds) throws Exception {
    Set deptIds = iRemoteSolverProxy.getDepartmentIds();
    Hashtable assignments = new Hashtable();
    Vector solverClassesOrClassIds = new Vector(classesOrClassIds.size());
    for (Iterator i=classesOrClassIds.iterator();i.hasNext();) {
        Object classOrClassId = i.next();
        if (classOrClassId instanceof Object[]) classOrClassId = ((Object[])classOrClassId)[0];
        Class_ clazz = (classOrClassId instanceof Class_ ? (Class_)classOrClassId : (new Class_DAO()).get((Long)classOrClassId));
        if (clazz.getManagingDept()==null || !deptIds.contains(clazz.getManagingDept().getUniqueId())) {
            Assignment assignment = iCommitedClassAssignmentProxy.getAssignment(clazz);
            if (assignment!=null)
                assignments.put(clazz.getUniqueId(), assignment);
        } else {
            solverClassesOrClassIds.add(clazz.getUniqueId());
        }
    }
    if (!solverClassesOrClassIds.isEmpty())
        assignments.putAll(iRemoteSolverProxy.getAssignmentTable2(solverClassesOrClassIds));
    return assignments;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:CourseSolverContainerRemote.java

示例2: getAssignmentInfoTable

import java.util.Hashtable; //导入方法依赖的package包/类
public Hashtable getAssignmentInfoTable(Collection classesOrClassIds) throws Exception {
    Set deptIds = iRemoteSolverProxy.getDepartmentIds();
    Hashtable infos = new Hashtable();
    Vector solverClassesOrClassIds = new Vector(classesOrClassIds.size());
    for (Iterator i=classesOrClassIds.iterator();i.hasNext();) {
        Object classOrClassId = i.next();
        if (classOrClassId instanceof Object[]) classOrClassId = ((Object[])classOrClassId)[0];
        Class_ clazz = (classOrClassId instanceof Class_ ? (Class_)classOrClassId : (new Class_DAO()).get((Long)classOrClassId));
        if (clazz.getManagingDept()==null || !deptIds.contains(clazz.getManagingDept().getUniqueId())) {
            AssignmentPreferenceInfo info = iCommitedClassAssignmentProxy.getAssignmentInfo(clazz);
            if (info!=null)
                infos.put(clazz.getUniqueId(), info);
        } else {
            solverClassesOrClassIds.add(clazz.getUniqueId());
        }
    }
    if (!solverClassesOrClassIds.isEmpty())
        infos.putAll(iRemoteSolverProxy.getAssignmentInfoTable2(solverClassesOrClassIds));
    return infos;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:CourseSolverContainerRemote.java

示例3: writeObject

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:BasicPermission.java

示例4: writeObject

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases. allPermission
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Class<?>, PermissionCollection> perms =
        new Hashtable<>(permsMap.size()*2); // no sync; estimate
    synchronized (this) {
        perms.putAll(permsMap);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();

    pfields.put("allPermission", allPermission); // no sync; staleness OK
    pfields.put("perms", perms);
    out.writeFields();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Permissions.java

示例5: writeObject

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
        new Hashtable<>(perms.size()*2);
    synchronized (this) {
        permissions.putAll(perms);
    }

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    out.writeFields();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:PropertyPermission.java

示例6: writeObject

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * and permClass unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
            new Hashtable<>(perms.size()*2);

    permissions.putAll(perms);

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    pfields.put("permClass", permClass);
    out.writeFields();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:BasicPermission.java

示例7: writeObject

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the permsMap field out as a Hashtable for
 * serialization compatibility with earlier releases. allPermission
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<Class<?>, PermissionCollection> perms =
        new Hashtable<>(permsMap.size()*2); // no sync; estimate
    perms.putAll(permsMap);

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();

    pfields.put("allPermission", allPermission); // no sync; staleness OK
    pfields.put("perms", perms);
    out.writeFields();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:Permissions.java

示例8: writeObject

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * @serialData Default fields.
 */
/*
 * Writes the contents of the perms field out as a Hashtable for
 * serialization compatibility with earlier releases. all_allowed
 * unchanged.
 */
private void writeObject(ObjectOutputStream out) throws IOException {
    // Don't call out.defaultWriteObject()

    // Copy perms into a Hashtable
    Hashtable<String, Permission> permissions =
        new Hashtable<>(perms.size()*2);
    permissions.putAll(perms);

    // Write out serializable fields
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("all_allowed", all_allowed);
    pfields.put("permissions", permissions);
    out.writeFields();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:PropertyPermission.java

示例9: main

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

    //create HashMap
    HashMap hMap = new HashMap();

    //populate HashMap
    hMap.put("1", "One");
    hMap.put("2", "Two");
    hMap.put("3", "Three");

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

    //populate Hashtable
    ht.put("1", "This value would be REPLACED !!");
    ht.put("4", "Four");

    //print values of Hashtable before copy from HashMap
    System.out.println("Hashtable contents before copy");
    Enumeration e = ht.elements();
    while (e.hasMoreElements()) System.out.println(e.nextElement());

    /*
      To copy values from HashMap to Hashtable use
      void putAll(Map m) method of Hashtable class.

      Please note that this method will REPLACE existing mapping of
      a key if any in the Hashtable
    */

    ht.putAll(hMap);

    //display contents of Hashtable
    System.out.println("Hashtable contents after copy");
    e = ht.elements();
    while (e.hasMoreElements()) System.out.println(e.nextElement());
  }
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:38,代码来源:CreateHashtableFromHashMap.java

示例10: updateCellOverlays

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * Returns a hashtable with all entries from the overlays variable where a
 * cell still exists in the model. The entries are removed from the global
 * hashtable so that the remaining entries reflect those whose cell have
 * been removed from the model. If no state is available for a given cell
 * then its overlays are temporarly removed from the rendering control, but
 * kept in the result.
 */
public Hashtable<Object, mxICellOverlay[]> updateCellOverlays(Object cell)
{
	Hashtable<Object, mxICellOverlay[]> result = new Hashtable<Object, mxICellOverlay[]>();
	mxICellOverlay[] c = overlays.remove(cell);
	mxCellState state = getGraph().getView().getState(cell);

	if (c != null)
	{
		if (state != null)
		{
			for (int i = 0; i < c.length; i++)
			{
				updateCellOverlayComponent(state, c[i]);
			}
		}
		else
		{
			for (int i = 0; i < c.length; i++)
			{
				removeCellOverlayComponent(c[i], cell);
			}
		}

		result.put(cell, c);
	}

	int childCount = getGraph().getModel().getChildCount(cell);

	for (int i = 0; i < childCount; i++)
	{
		result.putAll(updateCellOverlays(getGraph().getModel().getChildAt(
				cell, i)));
	}

	return result;
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:45,代码来源:mxGraphComponent.java

示例11: updateComponents

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * 
 */
public Hashtable<Object, Component[]> updateComponents(Object cell) {
  Hashtable<Object, Component[]> result = new Hashtable<Object, Component[]>();
  Component[] c = components.remove(cell);
  mxCellState state = getGraph().getView().getState(cell);

  if (state != null) {
    if (c == null) {
      c = createComponents(state);

      if (c != null) {
        for (int i = 0; i < c.length; i++) {
          insertComponent(state, c[i]);
        }
      }
    }

    if (c != null) {
      result.put(cell, c);

      for (int i = 0; i < c.length; i++) {
        updateComponent(state, c[i]);
      }
    }
  }
  // Puts the component back into the map so that it will be removed
  else if (c != null) {
    components.put(cell, c);
  }

  int childCount = getGraph().getModel().getChildCount(cell);

  for (int i = 0; i < childCount; i++) {
    result.putAll(updateComponents(getGraph().getModel().getChildAt(cell, i)));
  }

  return result;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:41,代码来源:mxGraphComponent.java

示例12: updateCellOverlays

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * Returns a hashtable with all entries from the overlays variable where a cell still exists in
 * the model. The entries are removed from the global hashtable so that the remaining entries
 * reflect those whose cell have been removed from the model. If no state is available for a given
 * cell then its overlays are temporarly removed from the rendering control, but kept in the
 * result.
 */
public Hashtable<Object, mxICellOverlay[]> updateCellOverlays(Object cell) {
  Hashtable<Object, mxICellOverlay[]> result = new Hashtable<Object, mxICellOverlay[]>();
  mxICellOverlay[] c = overlays.remove(cell);
  mxCellState state = getGraph().getView().getState(cell);

  if (c != null) {
    if (state != null) {
      for (int i = 0; i < c.length; i++) {
        updateCellOverlayComponent(state, c[i]);
      }
    } else {
      for (int i = 0; i < c.length; i++) {
        removeCellOverlayComponent(c[i], cell);
      }
    }

    result.put(cell, c);
  }

  int childCount = getGraph().getModel().getChildCount(cell);

  for (int i = 0; i < childCount; i++) {
    result.putAll(updateCellOverlays(getGraph().getModel().getChildAt(cell, i)));
  }

  return result;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:35,代码来源:mxGraphComponent.java

示例13: getDefaultIntialDirContext

import java.util.Hashtable; //导入方法依赖的package包/类
public InitialDirContext getDefaultIntialDirContext(int pageSize, AuthenticationDiagnostic diagnostic) throws AuthenticationException
{
    Hashtable<String, String> env = new Hashtable<String, String>(defaultEnvironment.size());
    env.putAll(defaultEnvironment);
    return buildInitialDirContext(env, pageSize, diagnostic);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:7,代码来源:LDAPInitialDirContextFactoryImpl.java

示例14: updateComponents

import java.util.Hashtable; //导入方法依赖的package包/类
/**
 * 
 */
public Hashtable<Object, Component[]> updateComponents(Object cell)
{
	Hashtable<Object, Component[]> result = new Hashtable<Object, Component[]>();
	Component[] c = components.remove(cell);
	mxCellState state = getGraph().getView().getState(cell);

	if (state != null)
	{
		if (c == null)
		{
			c = createComponents(state);

			if (c != null)
			{
				for (int i = 0; i < c.length; i++)
				{
					insertComponent(state, c[i]);
				}
			}
		}

		if (c != null)
		{
			result.put(cell, c);

			for (int i = 0; i < c.length; i++)
			{
				updateComponent(state, c[i]);
			}
		}
	}
	// Puts the component back into the map so that it will be removed
	else if (c != null)
	{
		components.put(cell, c);
	}

	int childCount = getGraph().getModel().getChildCount(cell);

	for (int i = 0; i < childCount; i++)
	{
		result.putAll(updateComponents(getGraph().getModel().getChildAt(
				cell, i)));
	}

	return result;
}
 
开发者ID:GDSRS,项目名称:TrabalhoFinalEDA2,代码行数:51,代码来源:mxGraphComponent.java


注:本文中的java.util.Hashtable.putAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。