本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}