gpt4 book ai didi

com.thoughtworks.xstream.persistence.XmlMap类的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 20:31:05 31 4
gpt4 key购买 nike

本文整理了Java中com.thoughtworks.xstream.persistence.XmlMap类的一些代码示例,展示了XmlMap类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlMap类的具体详情如下:
包路径:com.thoughtworks.xstream.persistence.XmlMap
类名称:XmlMap

XmlMap介绍

[英]A persistent map. Its values are actually serialized as xml files. If you need an application-wide synchronized version of this map, try the respective Collections methods.
[中]持久的映射。它的值实际上被序列化为xml文件。如果需要此映射的应用程序范围的同步版本,请尝试相应的集合方法。

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

public XmlSet(PersistenceStrategy persistenceStrategy) {
  this.map = new XmlMap(persistenceStrategy);
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

private Long findEmptyKey() {
  long i = System.currentTimeMillis();
  while (map.containsKey(new Long(i))) {
    i++;
  }
  return new Long(i);
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public boolean add(Object o) {
  if (map.containsValue(o)) {
    return false;
  } else {
    // not-synchronized!
    map.put(findEmptyKey(), o);
    return true;
  }
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public void add(int index, Object element) {
  int size = size();
  if (index >= (size + 1) || index < 0) {
    throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
        + size);
  }
  int to = index != size ? index - 1 : index;
  for (int i = size; i > to; i--) {
    map.put(new Integer(i + 1), map.get(new Integer(i)));
  }
  map.put(new Integer(index), element);
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public Object remove(int index) {
  int size = size();
  rangeCheck(index);
  Object value = map.get(new Integer(index));
  for (int i = index; i < size - 1; i++) {
    map.put(new Integer(i), map.get(new Integer(i + 1)));
  }
  map.remove(new Integer(size - 1));
  return value;
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public int size() {
  return map.size();
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public Iterator iterator() {
  return map.values().iterator();
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public boolean isEmpty() {
  return XmlMap.this.isEmpty();
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public Object get(int index) {
  rangeCheck(index);
  return map.get(new Integer(index));
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public Object set(int index, Object element) {
  rangeCheck(index);
  Object value = get(index);
  map.put(new Integer(index), element);
  return value;
}

代码示例来源:origin: org.jvnet.hudson/xstream

public Object remove(int index) {
  int size = size();
  rangeCheck(index);
  Object value = map.get(new Integer(index));
  for (int i = index; i < size - 1; i++) {
    map.put(new Integer(i), map.get(new Integer(i + 1)));
  }
  map.remove(new Integer(size - 1));
  return value;
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

public void add(int index, Object element) {
  int size = size();
  if (index >= (size + 1) || index < 0) {
    throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
        + size);
  }
  int to = index != size ? index - 1 : index;
  for (int i = size; i > to; i--) {
    map.put(new Integer(i + 1), map.get(new Integer(i)));
  }
  map.put(new Integer(index), element);
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

public int size() {
  return XmlMap.this.size();
}

代码示例来源:origin: x-stream/xstream

@Override
public Iterator<V> iterator() {
  return map.values().iterator();
}

代码示例来源:origin: org.jvnet.hudson/xstream

public boolean isEmpty() {
  return XmlMap.this.isEmpty();
}

代码示例来源:origin: x-stream/xstream

@Override
public V get(final int index) {
  rangeCheck(index);
  return map.get(Integer.valueOf(index));
}

代码示例来源:origin: x-stream/xstream

@Override
public V set(final int index, final V element) {
  rangeCheck(index);
  final V value = get(index);
  map.put(Integer.valueOf(index), element);
  return value;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

public Object remove(int index) {
  int size = size();
  rangeCheck(index);
  Object value = map.get(new Integer(index));
  for (int i = index; i < size - 1; i++) {
    map.put(new Integer(i), map.get(new Integer(i + 1)));
  }
  map.remove(new Integer(size - 1));
  return value;
}

代码示例来源:origin: x-stream/xstream

@Override
public boolean add(final V o) {
  if (map.containsValue(o)) {
    return false;
  } else {
    // not-synchronized!
    map.put(findEmptyKey(), o);
    return true;
  }
}

代码示例来源:origin: org.jvnet.hudson/xstream

public void add(int index, Object element) {
  int size = size();
  if (index >= (size + 1) || index < 0) {
    throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
        + size);
  }
  int to = index != size ? index - 1 : index;
  for (int i = size; i > to; i--) {
    map.put(new Integer(i + 1), map.get(new Integer(i)));
  }
  map.put(new Integer(index), element);
}

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com