@Test public void map() { final TreePattern<String> pattern = TreePattern.compile("3($x,$y,1)"); final TreePattern<Integer> ipattern = pattern.map(Integer::parseInt); Assert.assertEquals(ipattern.pattern().root().value(), Val.of(3)); Assert.assertEquals(ipattern.toString(), "3($x,$y,1)"); }
public <B> TreePattern<B> map(final Function<? super V, ? extends B> mapper) { return new TreePattern<>(_pattern.map(d -> d.map(mapper))); }
TreePattern implements Serializable { public <B> TreePattern<B> map(final Function<? super V, ? extends B> mapper) { return new TreePattern<>(_pattern.map(d -> d.map(mapper))); } }
TreePattern implements Serializable { public <B> TreePattern<B> map(final Function<? super V, ? extends B> mapper) { return new TreePattern<>(_pattern.map(d -> d.map(mapper))); } TreePattern(final Tree<Decl<V>, ?> pattern); }
TreePattern implements Serializable { public <B> TreePattern<B> map(final Function<? super V, ? extends B> mapper) { return new TreePattern<>(_pattern.map(d -> d.map(mapper))); } TreePattern(final Tree<Decl<V>, ?> pattern); SortedSet<Var<V>> vars(); TreePattern<B> map(final Function<? super V, ? extends B> mapper); TreeMatcher<V> matcher(final Tree<V, ?> tree); Optional<TreeMatchResult<V>> match(final Tree<V, ?> tree); boolean matches(final Tree<V, ?> tree); TreeNode<V> expand(final Map<Var<V>, Tree<V, ?>> vars); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static TreePattern<String> compile(final String pattern); static TreePattern<V> compile(
		final String pattern,
		final Function<? super String, ? extends V> mapper
	); }
TreePattern implements Serializable { public <B> TreePattern<B> map(final Function<? super V, ? extends B> mapper) { return new TreePattern<>(_pattern.map(d -> d.map(mapper))); } TreePattern(final Tree<Decl<V>, ?> pattern); SortedSet<Var<V>> vars(); TreePattern<B> map(final Function<? super V, ? extends B> mapper); TreeMatcher<V> matcher(final Tree<V, ?> tree); Optional<TreeMatchResult<V>> match(final Tree<V, ?> tree); boolean matches(final Tree<V, ?> tree); TreeNode<V> expand(final Map<Var<V>, Tree<V, ?>> vars); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static TreePattern<String> compile(final String pattern); static TreePattern<V> compile(
		final String pattern,
		final Function<? super String, ? extends V> mapper
	);  }