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


Java Pointer.allocateLong方法代码示例

本文整理汇总了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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:20,代码来源:Clingo.java

示例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;
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:10,代码来源:SymbolicAtoms.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:SymbolicAtoms.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:8,代码来源:Clingo.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:10,代码来源:StatisticsList.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:14,代码来源:Symbol.java

示例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;
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:SymbolicAtomIterator.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Signature.java

示例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();
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Model.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:SymbolicAtom.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Clingo.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:7,代码来源:StatisticsMap.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Symbol.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Symbol.java

示例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());
}
 
开发者ID:lorislab,项目名称:clingo4j,代码行数:6,代码来源:Symbol.java


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