コード例 #1
0
 /**
  * Tests if elements contained in a Stack <code>stack</code> is valid for the <code>TextTransition
  * </code>. This mehtod is supposed to be used internally by the Relaxer system.
  *
  * @param stack
  * @return boolean
  */
 public static boolean isMatch(RStack stack) {
   Element element = stack.peekElement();
   if (element == null) {
     return (false);
   }
   return (isMatch(element));
 }
コード例 #2
0
 /**
  * Tests if elements contained in a Stack <code>stack</code> is valid for the <code>TextTransition
  * </code>. This method consumes the stack contents during matching operation. This mehtod is
  * supposed to be used internally by the Relaxer system.
  *
  * @param stack
  * @return boolean
  */
 public static boolean isMatchHungry(RStack stack) {
   Element element = stack.peekElement();
   if (element == null) {
     return (false);
   }
   if (isMatch(element)) {
     stack.popElement();
     return (true);
   } else {
     return (false);
   }
 }