目录

boolean hasTransparentBounds()

描述 (Description)

java.time.Matcher.hasTransparentBounds()方法查询此匹配器的区域边界的透明度。

声明 (Declaration)

以下是java.time.Matcher.hasTransparentBounds()方法的声明。

public boolean hasTransparentBounds()

返回值 (Return Value)

如果此匹配器使用透明边界,则返回true,否则返回false。

例子 (Example)

以下示例显示了java.time.Matcher.hasTransparentBounds()方法的用法。

package com.iowiki;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MatcherDemo {
   private static String REGEX = "(a*b)(foo)";
   private static String INPUT = "aabfooaabfooabfoob";
   public static void main(String[] args) {
      Pattern pattern = Pattern.compile(REGEX);
      // get a matcher object
      Matcher matcher = pattern.matcher(INPUT);
      System.out.println("hasTransparentBounds(): " + matcher.hasTransparentBounds());
   }
}

让我们编译并运行上面的程序,这将产生以下结果 -

hasTransparentBounds(): false
↑回到顶部↑
WIKI教程 @2018