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


Java Syntax.getClass方法代码示例

本文整理汇总了Java中org.netbeans.editor.Syntax.getClass方法的典型用法代码示例。如果您正苦于以下问题:Java Syntax.getClass方法的具体用法?Java Syntax.getClass怎么用?Java Syntax.getClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.editor.Syntax的用法示例。


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

示例1: load

import org.netbeans.editor.Syntax; //导入方法依赖的package包/类
/** Goes through all the syntaxes and inits them. If the multi-state-info has
* valid state-info for the given syntax the state-info is used.
* Otherwise the syntax is inited to the init state.
*/
void load(MultiSyntax masterSyntax, char[] buffer, int offset, int len,
          boolean lastBuffer, int stopPosition) {
    SyntaxInfo syntaxItem = masterSyntax.slaveSyntaxChain;
    while (syntaxItem != null) {
        StateInfo loadInfo = null;
        int masterOffsetDelta = 0;
        Syntax s = syntaxItem.syntax;
        if (syntaxItem.active) {
            Class sc = s.getClass();
            ChainItem item = stateInfoChain;
            while (item != null) {
                if (item.syntaxClass == sc && item.valid) {
                    loadInfo = item.stateInfo;
                    masterOffsetDelta = item.masterOffsetDelta;
                    break;
                }
                item = item.prev;
            }
        }
        s.load(loadInfo, buffer, offset + masterOffsetDelta,
               len - masterOffsetDelta, lastBuffer, stopPosition);
        syntaxItem = syntaxItem.next;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:MultiSyntax.java

示例2: store

import org.netbeans.editor.Syntax; //导入方法依赖的package包/类
void store(MultiSyntax masterSyntax) {
    // Invalidate all state-info chain items
    ChainItem item = stateInfoChain;
    while (item != null) {
        item.valid = false;
        item = item.prev;
    }

    // Go through active syntaxes and store their info and master-offset
    SyntaxInfo syntaxItem = masterSyntax.slaveSyntaxChain;
    while (syntaxItem != null) {
        if (syntaxItem.active) {
            Syntax s = syntaxItem.syntax;
            Class sc = s.getClass();
            item = stateInfoChain;
            while (item != null) {
                if (item.syntaxClass == sc) { // found right item
                    break;
                }
                item = item.prev;
            }
            if (item == null) { // not found, add new
                item = stateInfoChain = new ChainItem(s.createStateInfo(),
                                                      sc, stateInfoChain);
            }
            // Store the state and compute masterOffsetDelta
            s.storeState(item.stateInfo);
            item.masterOffsetDelta = s.getOffset() - masterSyntax.getOffset();
            item.valid = true;
        }
        syntaxItem = syntaxItem.next;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:MultiSyntax.java


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