本文整理汇总了Java中org.netbeans.editor.Syntax.EQUAL_STATE属性的典型用法代码示例。如果您正苦于以下问题:Java Syntax.EQUAL_STATE属性的具体用法?Java Syntax.EQUAL_STATE怎么用?Java Syntax.EQUAL_STATE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.netbeans.editor.Syntax
的用法示例。
在下文中一共展示了Syntax.EQUAL_STATE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compare
int compare(MultiSyntax masterSyntax) {
int ret = Syntax.EQUAL_STATE;
// Go through valid state-info chain items
ChainItem item = stateInfoChain;
while (item != null && ret == Syntax.EQUAL_STATE) {
if (item.valid) {
Class sc = item.syntaxClass;
SyntaxInfo syntaxItem = masterSyntax.slaveSyntaxChain;
while (syntaxItem != null) {
if (syntaxItem.syntax.getClass() == sc) {
if (syntaxItem.active) {
ret = syntaxItem.syntax.compareState(item.stateInfo);
} else { // syntax not active but should be
ret = Syntax.DIFFERENT_STATE;
}
break;
}
syntaxItem = syntaxItem.next;
}
}
item = item.prev;
}
return ret;
}
示例2: compareSubStates
/** @return whether passed substates equals to this substates. */
public int compareSubStates(int[] sub) {
if (states == null) return Syntax.DIFFERENT_STATE;
if (sub == null) return Syntax.DIFFERENT_STATE;
if (states.length != sub.length) return Syntax.DIFFERENT_STATE;
for (int i = states.length-1; i>=0; i--) { //faster
if (states[i] != sub[i]) return Syntax.DIFFERENT_STATE;
}
return Syntax.EQUAL_STATE;
}