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


Java IntHolder类代码示例

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


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

示例1: readVInt

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
private int readVInt(IntHolder pos) {
	byte b = this.concatenated[pos.value];
	pos.value++;
	if (b >= 0) {
		return b;
	} else {
		int res = (b & 0x7F);
		int shift = 7;
		while (true) {
			b = this.concatenated[pos.value];
			pos.value++;
			if (b > 0) {
				res = res | (b << shift);
				break;
			} else {
				res = res | ((b & 0x7F) << shift);
				shift += 7;
			}
		}
		return res;
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:23,代码来源:VIntIndexedTransactionsList.java

示例2: getTask

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
public synchronized CandidateCounters getTask(IntHolder boundHolder) throws StopPreparingJobsException,
		StopResumingJobsException {
	while (!stackedEs.isEmpty() && stackedEs.peek().getCandidate() == this.nextConsumable) {
		this.nextConsumable++;
		CandidateCounters next = stackedEs.poll();
		if (next.getNewCandidateBound() > 0) {
			this.minBoundToNextConsumable = Math
					.min(this.minBoundToNextConsumable, next.getNewCandidateBound());
		}
		if (next.counters != null) {
			boundHolder.value = this.minBoundToNextConsumable;
			return next;
		}
	}
	if (this.nextConsumable >= ExplorationStep.INSERT_UNCLOSED_UP_TO_ITEM) {
		if (this.stackedEs.isEmpty()) {
			throw new StopResumingJobsException();
		} else {
			throw new StopPreparingJobsException();
		}
	}
	boundHolder.value = this.minBoundToNextConsumable;
	return null;
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:25,代码来源:TopPI.java

示例3: readPart

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Read the name part (id or kind).
 *
 * @param p the current position. After reading, advances
 * to the beginning of the next name fragment.
 *
 * @param t the string buffer.
 *
 * @return the name part with resolved escape sequences.
 */
private String readPart(IntHolder p, String[] t)
{
  CPStringBuilder part = new CPStringBuilder();

  while (t [ p.value ] != null && !t [ p.value ].equals(".") &&
         !t [ p.value ].equals("/")
        )
    {
      if (t [ p.value ].equals(ESCAPE))
        {
          p.value++;
          part.append(t [ p.value ]);
        }
      else
        part.append(t [ p.value ]);

      p.value++;
    }

  return part.toString();
}
 
开发者ID:vilie,项目名称:javify,代码行数:32,代码来源:NameTransformer.java

示例4: shouldSupportATrailingOption

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldSupportATrailingOption() throws InterruptedException, ExecutionException {
	DebounceOptions<Void> o0 = new DebounceOptions<Void>().executor(executor).trailing(true);
	DebounceOptions<Void> o1 = new DebounceOptions<Void>().executor(executor).trailing(false);

	IntHolder withCount = new IntHolder(0);
	IntHolder withoutCount = new IntHolder(0);

	Runnable withTrailing = Lodash.debounce(() -> {
		withCount.value++;
	} , 32, o0);
	Runnable withoutTrailing = Lodash.debounce(() -> {
		withoutCount.value++;
	} , 32, o1);

	withTrailing.run();
	Assert.assertEquals(0, withCount.value);

	withoutTrailing.run();
	Assert.assertEquals(0, withoutCount.value);

	o1.setTimeout().apply(() -> {
		Assert.assertEquals(1, withCount.value);
		Assert.assertEquals(0, withoutCount.value);
	} , 64L).get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:27,代码来源:LodashDebounceTests.java

示例5: shouldSupportAMaxWaitOption

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldSupportAMaxWaitOption() throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);
	DebounceOptions<Void> o = new DebounceOptions<Void>().executor(executor).maxWait(64);
	Runnable debounced = Lodash.debounce(() -> {
		callCount.value++;
	} , 32, o);
	debounced.run();
	debounced.run();
	Assert.assertEquals(0, callCount.value);

	Future<?> f1 = o.setTimeout().apply(() -> {
		Assert.assertEquals(1, callCount.value);
		debounced.run();
		debounced.run();
		Assert.assertEquals(1, callCount.value);
	} , 128L);
	Future<?> f2 = o.setTimeout().apply(() -> {
		Assert.assertEquals(2, callCount.value);
	} , 256L);

	f1.get();
	f2.get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:25,代码来源:LodashDebounceTests.java

示例6: shouldQueueATrailingCallForSubsequentDebouncedCallsAfterMaxWait

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldQueueATrailingCallForSubsequentDebouncedCallsAfterMaxWait()
		throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);
	DebounceOptions<Void> o = new DebounceOptions<Void>().executor(executor).maxWait(200);
	Runnable debounced = Lodash.debounce(() -> {
		callCount.value++;
	} , 200, o);

	debounced.run();

	o.setTimeout().apply(debounced, 190L);
	o.setTimeout().apply(debounced, 200L);
	o.setTimeout().apply(debounced, 210L);

	o.setTimeout().apply(() -> {
		Assert.assertEquals(2, callCount.value);
	} , 500L).get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:20,代码来源:LodashDebounceTests.java

示例7: shouldInvokeTheTrailingCallWithTheCorrectArguments

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
@Test
public void shouldInvokeTheTrailingCallWithTheCorrectArguments() throws InterruptedException, ExecutionException {
	IntHolder callCount = new IntHolder(0);
	DebounceOptions<Boolean> o = new DebounceOptions<Boolean>().executor(executor).leading(true).maxWait(64);

	List<Integer> actualA = new ArrayList<>();
	List<String> actualB = new ArrayList<>();

	BiFunction<Integer, String, Boolean> debounced = Lodash.debounce((a, b) -> {
		actualA.add(a);
		actualB.add(b);
		return ++callCount.value != 2;
	} , 32, o);

	while (true) {
		if (!debounced.apply(1, "a")) {
			break;
		}
	}

	o.setTimeout().apply(() -> {
		Assert.assertEquals(2, callCount.value);
		Assert.assertEquals(Arrays.asList(1, 1), actualA);
		Assert.assertEquals(Arrays.asList("a", "a"), actualB);
	} , 64L).get();
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:27,代码来源:LodashDebounceTests.java

示例8: initStack

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
void initStack( Node start )
{
	Node child = start;
	Node parent = child.getParent( );
	
	final Stack<IntHolder> revStack = new Stack<IntHolder>( );
	
	while( parent != null )
	{
		if( parent instanceof Group )
		{
			revStack.push( new IntHolder( ( ( Group ) parent ).indexOfChild( child ) ) );
		}
		child = parent;
		parent = child.getParent( );
	}
	
	while( !revStack.isEmpty( ) )
	{
		indexStack.push( revStack.pop( ) );
	}
}
 
开发者ID:jedwards1211,项目名称:breakout,代码行数:23,代码来源:SceneGraphIterator.java

示例9: nextPreprocessed

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
public Counters nextPreprocessed(PerItemTopKCollector collector, IntHolder candidateHolder, IntHolder boundHolder) {
	if (this.candidates == null) {
		candidateHolder.value = -1;
		return null;
	}
	int candidate = this.candidates.next();

	if (candidate < 0) {
		candidateHolder.value = -1;
		return null;
	} else {
		candidateHolder.value = candidate;
		return this.prepareExploration(candidate, collector, boundHolder);
	}
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:16,代码来源:ExplorationStep.java

示例10: resumeExploration

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
public ExplorationStep resumeExploration(Counters candidateCounts, int candidate, PerItemTopKCollector collector,
		int countersMinSupportVerification) {
	if (ultraVerbose) {
		System.err.format("{\"time\":\"%1$tY/%1$tm/%1$td %1$tk:%1$tM:%1$tS\",\"thread\":%2$d,\"resume_candidate\":%3$d}\n",
						Calendar.getInstance(), Thread.currentThread().getId(), candidate);
	}
	
	// check that the counters we made are also ok for all items < candidate
	if (candidateCounts.getMinSupport() > countersMinSupportVerification &&
			candidateCounts.getMinSupport() > this.counters.getMinSupport()) {
		CountersHandler.increment(TopPICounters.RedoCounters);
		candidateCounts = prepareExploration(candidate, collector, new IntHolder(countersMinSupportVerification),
				true);
	}
	if (candidate < INSERT_UNCLOSED_UP_TO_ITEM) {
		candidateCounts.raiseMinimumSupport(collector);
		if (LOG_EPSILONS) {
			synchronized (System.out) {
				if (this.counters != null && this.counters.getPattern() != null
						&& this.counters.getPattern().length == 0) {
					System.out.println(candidate + " " + candidateCounts.getMinSupport());
				}
			}
		}
	}
	Dataset dataset = this.datasetProvider.getDatasetForSupportThreshold(candidateCounts.getMinSupport());
	ExplorationStep next = new ExplorationStep(this, dataset, candidate, candidateCounts,
			dataset.getSupport(candidate));
	return next;
}
 
开发者ID:slide-lig,项目名称:TopPI,代码行数:31,代码来源:ExplorationStep.java

示例11: get_long

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public int get_long() throws TypeMismatch
{
  try
    {
      return ((IntHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:15,代码来源:gnuDynAny.java

示例12: insert_long

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public void insert_long(int a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((IntHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:gnuDynAny.java

示例13: insert_ulong

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/** {@inheritDoc} */
public void insert_ulong(int a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((IntHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:gnuDynAny.java

示例14: toName

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Convert the string name representation into the array name
 * representation. See {@link #toString(NameComponent)} for the
 * description of this format.
 *
 * @param a_name the string form of the name.
 *
 * @return the array form of the name.
 *
 * @throws InvalidName if the name cannot be parsed.
 */
public NameComponent[] toName(String a_name)
                       throws InvalidName
{
  ArrayList components = new ArrayList();
  StringTokenizer st = new StringTokenizer(a_name, "./\\", true);

  // Create the buffer array, reserving the last element for null.
  String[] n = new String[ st.countTokens() + 1 ];

  int pp = 0;
  while (st.hasMoreTokens())
    n [ pp++ ] = st.nextToken();

  IntHolder p = new IntHolder();

  NameComponent node = readNode(p, n);

  while (node != null)
    {
      components.add(node);
      node = readNode(p, n);
    }

  NameComponent[] name = new NameComponent[ components.size() ];
  for (int i = 0; i < name.length; i++)
    {
      name [ i ] = (NameComponent) components.get(i);
    }

  NameValidator.check(name);

  return name;
}
 
开发者ID:vilie,项目名称:javify,代码行数:45,代码来源:NameTransformer.java

示例15: assertEndOfNode

import org.omg.CORBA.IntHolder; //导入依赖的package包/类
/**
 * Assert the end of the current name component.
 */
private void assertEndOfNode(IntHolder p, String[] t)
                      throws InvalidName
{
  if (t [ p.value ] != null)
    if (!t [ p.value ].equals("/"))
      throw new InvalidName("End of node expected at token " + p.value);
}
 
开发者ID:vilie,项目名称:javify,代码行数:11,代码来源:NameTransformer.java


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