@Override public T getById(@Nonnull final Integer id) { synchronized (this) { return find(entities, new JPredicate<T>() { @Override public boolean apply(@Nullable T t) { return t != null && t.getId().equals(id); } }); } }
@Nullable @Override public MutableTreeNode<T> findOwnChild(@Nonnull JPredicate<TreeNode<T>> finder) { return org.solovyev.common.collections.Collections.find(children.iterator(), finder); }
public static <T> boolean contains(@Nullable Collection<T> list, @Nonnull FilterType filterType, @Nonnull JPredicate<T> finder) { boolean found = find(list, finder) != null; final boolean result; if (filterType == FilterType.included) { result = found; } else { result = !found; } return result; }
private boolean contains(final String name, @Nonnull Collection<T> entities) { synchronized (this) { return find(entities, new MathEntity.Finder<T>(name)) != null; } }
@Nullable public static <T> T find(@Nonnull T value, @Nullable Collection<T> list, @Nullable Equalizer<T> equalizer) { return find(list, new EqualsFinder<T>(value, equalizer)); }
@Override @Nullable public T get(@Nonnull final String name) { synchronized (this) { return find(entities, new MathEntity.Finder<T>(name)); } }
final String s = Collections.find(mathType.getTokens(), startsWithFinder); if (s != null) { if (s.length() == 1) {
String functionName = Collections.find(MathType.function.getTokens(), startsWithFinder); if (functionName == null) { String operatorName = Collections.find(MathType.operator.getTokens(), startsWithFinder); if (operatorName == null) { String varName = Collections.find(Locator.getInstance().getEngine().getVarsRegistry().getNames(), startsWithFinder); if (varName != null) { final IConstant var = Locator.getInstance().getEngine().getVarsRegistry().get(varName);
IConstant constant = Collections.find(this.getConstantsRegistry().getSystemEntities(), new JPredicate<IConstant>() { @Override public boolean apply(@Nullable IConstant constant) {
Collections.find(MathType.openGroupSymbols, startsWithFinder) != null) { final String functionName = mathTypeBefore.getMatch(); final Function function = Locator.getInstance().getEngine().getFunctionsRegistry().get(functionName);