本文整理汇总了Java中org.bridj.Pointer.allocateLong方法的典型用法代码示例。如果您正苦于以下问题:Java Pointer.allocateLong方法的具体用法?Java Pointer.allocateLong怎么用?Java Pointer.allocateLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bridj.Pointer
的用法示例。
在下文中一共展示了Pointer.allocateLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseTerm
import org.bridj.Pointer; //导入方法依赖的package包/类
public static Symbol parseTerm(String term, ClingoLogger logger, int messageLimit) throws ClingoException {
Pointer<Long> ret = Pointer.allocateLong();
Pointer<ClingoLibrary.clingo_logger_t> p_logger = null;
if (logger != null) {
clingo_logger_t log = new clingo_logger_t() {
public void apply(int code, Pointer<Byte> message, Pointer<?> data) {
try {
logger.warn(EnumValue.valueOfInt(WarningCode.class, code), message.getCString());
} catch (Exception e) {
// ignore
}
}
};
p_logger = Pointer.getPointer(log);
}
handleError(LIB.clingo_parse_term(Pointer.pointerToCString(term), p_logger, null, messageLimit, ret), "Error parse term!");
return new Symbol(ret.get());
}
示例2: find
import org.bridj.Pointer; //导入方法依赖的package包/类
public SymbolicAtom find(Symbol atom) throws ClingoException {
Pointer<Long> iter = Pointer.allocateLong();
handleError(LIB.clingo_symbolic_atoms_find(pointer, atom.getStructObject(), iter), "Error reading the symbolic atoms by symbol");
SymbolicAtomIterator iterator = new SymbolicAtomIterator(pointer, iter.get(), 0);
if (iterator.isValidIterator()) {
return iterator.get();
}
return null;
}
示例3: iterator
import org.bridj.Pointer; //导入方法依赖的package包/类
public Iterator<SymbolicAtom> iterator(Symbol atom) throws ClingoException {
Pointer<Long> iter = Pointer.allocateLong();
handleError(LIB.clingo_symbolic_atoms_find(pointer, atom.getStructObject(), iter), "Error reading the symbolic atoms by symbol");
Pointer<Long> end = Pointer.allocateLong();
handleError(LIB.clingo_symbolic_atoms_end(pointer, end), "Error reading the symbolic atoms iterator end!");
return new SymbolicAtomIterator(pointer, iter.get(), end.get());
}
示例4: getStatistics
import org.bridj.Pointer; //导入方法依赖的package包/类
public Statistics getStatistics() throws ClingoException {
Pointer<Pointer<clingo_statistic>> statistics = Pointer.allocatePointer(clingo_statistic.class);
handleError(LIB.clingo_control_statistics(pointer, statistics), "Error reading the statistics!");
Pointer<Long> key = Pointer.allocateLong();
handleError(LIB.clingo_statistics_root(statistics.get(), key), "Error reading the statistics root key!");
return new Statistics(statistics.get(), key.getLong());
}
示例5: get
import org.bridj.Pointer; //导入方法依赖的package包/类
@Override
public Statistics get(int index) {
if (0 <= index && index < size()) {
Pointer<Long> subkey = Pointer.allocateLong();
handleRuntimeError(LIB.clingo_statistics_array_at(pointer, key, index, subkey), "Error reading the statistic item in array at " + index + " position!");
return new Statistics(pointer, subkey.getLong());
}
throw new IndexOutOfBoundsException();
}
示例6: createFunction
import org.bridj.Pointer; //导入方法依赖的package包/类
public static Symbol createFunction(String name, List<Symbol> symbols, boolean positive) throws ClingoException {
Pointer<Long> pointer = Pointer.allocateLong();
int size = 0;
Pointer<Long> arguments = null;
if (symbols != null && !symbols.isEmpty()) {
arguments = Symbol.array(symbols);
size = symbols.size();
}
handleError(LIB.clingo_symbol_create_function(Pointer.pointerToCString(name), arguments, size, positive, pointer), "Error creating the function!");
return new Symbol(pointer.get());
}
示例7: nextIterator
import org.bridj.Pointer; //导入方法依赖的package包/类
public SymbolicAtomIterator nextIterator() throws ClingoException {
Pointer<Long> next = Pointer.allocateLong();
handleError(LIB.clingo_symbolic_atoms_next(atoms, iter, next), "Error reading the next atoms!");
iter = next.get();
return this;
}
示例8: Signature
import org.bridj.Pointer; //导入方法依赖的package包/类
public Signature(String name, int arity, boolean positive) throws ClingoException {
Pointer<Long> tmp = Pointer.allocateLong();
handleError(LIB.clingo_signature_create(Pointer.pointerToCString(name), arity, positive, tmp), "Error creating the signature!");
pointer = tmp.get();
}
示例9: getNumber
import org.bridj.Pointer; //导入方法依赖的package包/类
public long getNumber() throws ClingoException {
Pointer<Long> ret = Pointer.allocateLong();
handleError(LIB.clingo_model_number(pointer, ret), "Error reading the model number!");
return ret.get();
}
示例10: getSymbol
import org.bridj.Pointer; //导入方法依赖的package包/类
public Symbol getSymbol() throws ClingoException {
Pointer<Long> symbol = Pointer.allocateLong();
handleError(LIB.clingo_symbolic_atoms_symbol(pointer, iterator, symbol), "Error readint the atoms symbol!");
return new Symbol(symbol.get());
}
示例11: getConst
import org.bridj.Pointer; //导入方法依赖的package包/类
public Symbol getConst(String name) throws ClingoException {
Pointer<Long> ret = Pointer.allocateLong();
handleError(LIB.clingo_control_get_const(pointer, Pointer.pointerToCString(name), ret), "Error get const " + name);
return new Symbol(ret.get());
}
示例12: get
import org.bridj.Pointer; //导入方法依赖的package包/类
public Statistics get(String name) {
Pointer<Byte> tmp = Pointer.pointerToCString(name);
Pointer<Long> subkey = Pointer.allocateLong();
handleRuntimeError(LIB.clingo_statistics_map_at(pointer, key, tmp, subkey), "Error reading the statistic item in map by" + tmp + " key!");
return new Statistics(pointer, subkey.getLong());
}
示例13: createId
import org.bridj.Pointer; //导入方法依赖的package包/类
public static Symbol createId(String name, boolean positive) throws ClingoException {
Pointer<Long> pointer = Pointer.allocateLong();
handleError(LIB.clingo_symbol_create_id(Pointer.pointerToCString(name), positive, pointer), "Error creating the ID!");
return new Symbol(pointer.get());
}
示例14: createString
import org.bridj.Pointer; //导入方法依赖的package包/类
public static Symbol createString(String string) throws ClingoException {
Pointer<Long> pointer = Pointer.allocateLong();
handleError(LIB.clingo_symbol_create_string(Pointer.pointerToCString(string), pointer), "Error creating the string!");
return new Symbol(pointer.get());
}
示例15: createNumber
import org.bridj.Pointer; //导入方法依赖的package包/类
public static Symbol createNumber(int number) {
Pointer<Long> pointer = Pointer.allocateLong();
LIB.clingo_symbol_create_number(number, pointer);
return new Symbol(pointer.get());
}