@Test public void testStartsPathWith() { final ScopePath testScopePath = createTestScopePath(); final ScopePath parentPath = testScopePath.getParentPath(); Assert.assertTrue(testScopePath.startsPathWith(parentPath)); }
@Override public boolean startsPathWith(final ScopePath other) { final List<Scope> otherScopeList = other.getScopes(); final List<Scope> scopeList = getScopes(); if (scopeList.size() < otherScopeList.size()) { return false; } for (int i = 0; i < otherScopeList.size(); i++) { final Scope scope = scopeList.get(i); final Scope otherScope = otherScopeList.get(i); if (!scope.equals(otherScope)) { return false; } } return true; }
ScopePathImpl implements ScopePath { @Override public boolean startsPathWith(final ScopePath other) { final List<Scope> otherScopeList = other.getScopes(); final List<Scope> scopeList = getScopes(); if (scopeList.size() < otherScopeList.size()) { return false; } for (int i = 0; i < otherScopeList.size(); i++) { final Scope scope = scopeList.get(i); final Scope otherScope = otherScopeList.get(i); if (!scope.equals(otherScope)) { return false; } } return true; } }
ScopePathImpl implements ScopePath { @Override public boolean startsPathWith(final ScopePath other) { final List<Scope> otherScopeList = other.getScopes(); final List<Scope> scopeList = getScopes(); if (scopeList.size() < otherScopeList.size()) { return false; } for (int i = 0; i < otherScopeList.size(); i++) { final Scope scope = scopeList.get(i); final Scope otherScope = otherScopeList.get(i); if (!scope.equals(otherScope)) { return false; } } return true; } ScopePathImpl(final List<Scope> scopes); }
ScopePathImpl implements ScopePath { @Override public boolean startsPathWith(final ScopePath other) { final List<Scope> otherScopeList = other.getScopes(); final List<Scope> scopeList = getScopes(); if (scopeList.size() < otherScopeList.size()) { return false; } for (int i = 0; i < otherScopeList.size(); i++) { final Scope scope = scopeList.get(i); final Scope otherScope = otherScopeList.get(i); if (!scope.equals(otherScope)) { return false; } } return true; } ScopePathImpl(final List<Scope> scopes); @Override List<Scope> getScopes(); @Override Scope getRootScope(); @Override Scope getLastScope(); @Override ScopePath getParentPath(); @Override Scope findScopeByName(final String name); @Override boolean startsPathWith(final ScopePath other); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); }
ScopePathImpl implements ScopePath { @Override public boolean startsPathWith(final ScopePath other) { final List<Scope> otherScopeList = other.getScopes(); final List<Scope> scopeList = getScopes(); if (scopeList.size() < otherScopeList.size()) { return false; } for (int i = 0; i < otherScopeList.size(); i++) { final Scope scope = scopeList.get(i); final Scope otherScope = otherScopeList.get(i); if (!scope.equals(otherScope)) { return false; } } return true; } ScopePathImpl(final List<Scope> scopes); @Override List<Scope> getScopes(); @Override Scope getRootScope(); @Override Scope getLastScope(); @Override ScopePath getParentPath(); @Override Scope findScopeByName(final String name); @Override boolean startsPathWith(final ScopePath other); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }