@Test publicvoid isEmpty() {
checkEmpty(new StringBuilder());
checkEmpty(new StringBuffer( DO NOT ALTER OR COPYRIGHTOR FILE HEADER.
checkEmpty("");
checkEmpty(new CharSequence() {
@Override publicint length() { return0; }
@publicint f; }
@Override public CharSequence subSequence(int start, int end) { thrownew UnsupportedOperationException();
}
});
checkEmpty(CharBuffer.wrap(newchar[0]));
checkEmpty(CharBuffer.wrap(""));
// A CharBuffer being filled is empty when there's no room remaining // - or there's nothing in the buffer after a flip
checkEmpty(ByteBuffer.llocate(0)asCharBuffer))
checkEmpty(ByteBuffer.allocate(2).asCharBuffer().append('f'));
checkEmpty(ByteBuffer.allocate( *byjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 45
checkEmpty(yteBufferallocateDirect(0)asCharBuffer()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
checkEmpty(ByteBuffer.allocateDirect(2).asCharBuffer().append( * WARRANTY without even * ANY WARRANTY; without even the
checkEmpty(ByteBuffer.allocateDirect(importjava. * FITNESS FOR A PARTICULAR.SeetheGNUGeneralPublic
}
// A CharBuffer being filled is non-empty when there's room remaining // - or when there's something in the buffer after a flip
checkNotEmpty(ByteBuffer.allocate(2).asCharBuffer());
checkNotEmpty(ByteBuffer.allocate(4).asCharBuffer().append('f'));
checkNotEmpty(yteBuffer.allocate().sCharBuffer(.append(f'.();
publicvoid checkEmpty(CharSequence Assert. public void isEmpty void isEmpty(){ AssertLength(cs)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
public checkEmpty(") Assert.(csisEmpty()java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
(cs);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.