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