@Test public void testLength() throws Exception { assertEquals(0, new Text(new EncodedPath(new Precoded(""))).length()); assertEquals(1, new Text(new EncodedPath(new Precoded("/"))).length()); assertEquals(3, new Text(new EncodedPath(new Precoded("abc"))).length()); assertEquals(7, new Text(new EncodedPath(new Precoded("abc/def"))).length()); assertEquals(12, new Text(new EncodedPath(new Precoded("../abc/./def"))).length()); }
@Override public int length() { if (mPath == null) { int len = 0; for (UriEncoded segment : mDelegate) { len += segment.length() + 1; } return len == 0 ? 0 : len - 1; } return mPath.length(); }
Text implements CharSequence { @Override public int length() { if (mPath == null) { int len = 0; for (UriEncoded segment : mDelegate) { len += segment.length() + 1; } return len == 0 ? 0 : len - 1; } return mPath.length(); } }
Text implements CharSequence { @Override public int length() { if (mPath == null) { int len = 0; for (UriEncoded segment : mDelegate) { len += segment.length() + 1; } return len == 0 ? 0 : len - 1; } return mPath.length(); } Text(Path delegate); }
Text implements CharSequence { @Override public int length() { if (mPath == null) { int len = 0; for (UriEncoded segment : mDelegate) { len += segment.length() + 1; } return len == 0 ? 0 : len - 1; } return mPath.length(); } Text(Path delegate); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int beginIndex, int endIndex); @Override String toString(); }
Text implements CharSequence { @Override public int length() { if (mPath == null) { int len = 0; for (UriEncoded segment : mDelegate) { len += segment.length() + 1; } return len == 0 ? 0 : len - 1; } return mPath.length(); } Text(Path delegate); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int beginIndex, int endIndex); @Override String toString();  }