本文整理匯總了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;
}