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


Java IntrusiveCollection类代码示例

本文整理汇总了Java中org.apache.hadoop.util.IntrusiveCollection的典型用法代码示例。如果您正苦于以下问题:Java IntrusiveCollection类的具体用法?Java IntrusiveCollection怎么用?Java IntrusiveCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: insertInternal

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override // IntrusiveCollection.Element
public void insertInternal(IntrusiveCollection<? extends Element> list,
    Element prev, Element next) {
  assert this.pool == null;
  this.pool = ((CachePool.DirectiveList)list).getCachePool();
  this.prev = prev;
  this.next = next;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:CacheDirective.java

示例2: removeInternal

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override // IntrusiveCollection.Element
public void removeInternal(IntrusiveCollection<? extends Element> list) {
  assert list == pool.getDirectiveList();
  this.pool = null;
  this.prev = null;
  this.next = null;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:CacheDirective.java

示例3: getPrev

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override // IntrusiveCollection.Element
public Element getPrev(IntrusiveCollection<? extends Element> list) {
  if (list != pool.getDirectiveList()) {
    return null;
  }
  return this.prev;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:CacheDirective.java

示例4: getNext

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override // IntrusiveCollection.Element
public Element getNext(IntrusiveCollection<? extends Element> list) {
  if (list != pool.getDirectiveList()) {
    return null;
  }
  return this.next;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:CacheDirective.java

示例5: insertInternal

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public void insertInternal(IntrusiveCollection<? extends Element> list, Element prev,
    Element next) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      throw new RuntimeException("Trying to re-insert an element that " +
          "is already in the list.");
    }
  }
  Object newTriplets[] = Arrays.copyOf(triplets, triplets.length + 3);
  newTriplets[triplets.length] = list;
  newTriplets[triplets.length + 1] = prev;
  newTriplets[triplets.length + 2] = next;
  triplets = newTriplets;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:CachedBlock.java

示例6: setPrev

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public void setPrev(IntrusiveCollection<? extends Element> list, Element prev) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      triplets[i + 1] = prev;
      return;
    }
  }
  throw new RuntimeException("Called setPrev on an element that wasn't " +
      "in the list.");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:CachedBlock.java

示例7: setNext

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public void setNext(IntrusiveCollection<? extends Element> list, Element next) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      triplets[i + 2] = next;
      return;
    }
  }
  throw new RuntimeException("Called setNext on an element that wasn't " +
      "in the list.");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:CachedBlock.java

示例8: removeInternal

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public void removeInternal(IntrusiveCollection<? extends Element> list) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      Object[] newTriplets = new Object[triplets.length - 3];
      System.arraycopy(triplets, 0, newTriplets, 0, i);
      System.arraycopy(triplets, i + 3, newTriplets, i,
          triplets.length - (i + 3));
      triplets = newTriplets;
      return;
    }
  }
  throw new RuntimeException("Called remove on an element that wasn't " +
      "in the list.");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:CachedBlock.java

示例9: getPrev

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public Element getPrev(IntrusiveCollection<? extends Element> list) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      return (Element)triplets[i + 1];
    }
  }
  throw new RuntimeException("Called getPrev on an element that wasn't " +
      "in the list.");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:CachedBlock.java

示例10: getNext

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public Element getNext(IntrusiveCollection<? extends Element> list) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      return (Element)triplets[i + 2];
    }
  }
  throw new RuntimeException("Called getNext on an element that wasn't " +
      "in the list.");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:CachedBlock.java

示例11: isInList

import org.apache.hadoop.util.IntrusiveCollection; //导入依赖的package包/类
@Override
public boolean isInList(IntrusiveCollection<? extends Element> list) {
  for (int i = 0; i < triplets.length; i += 3) {
    if (triplets[i] == list) {
      return true;
    }
  }
  return false;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:CachedBlock.java


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