@Test public void contains() { assertTrue(empty.contains(empty)); assertTrue(fromString("hello").contains(fromString("ello"))); assertFalse(fromString("hello").contains(fromString("vello"))); assertFalse(fromString("hello").contains(fromString("hellooo"))); assertTrue(fromString("大千世界").contains(fromString("千世界"))); assertFalse(fromString("大千世界").contains(fromString("世千"))); assertFalse(fromString("大千世界").contains(fromString("大千世界好"))); }
public boolean contains(final BinaryString s) { ensureMaterialized(); s.ensureMaterialized(); if (s.sizeInBytes == 0) { return true; } int find = SegmentsUtil.find( segments, offset, sizeInBytes, s.segments, s.offset, s.sizeInBytes); return find != -1; }
BinaryString extends LazyBinaryFormat<String> implements Comparable<BinaryString> { public boolean contains(final BinaryString s) { ensureMaterialized(); s.ensureMaterialized(); if (s.sizeInBytes == 0) { return true; } int find = SegmentsUtil.find( segments, offset, sizeInBytes, s.segments, s.offset, s.sizeInBytes); return find != -1; } }
BinaryString extends LazyBinaryFormat<String> implements Comparable<BinaryString> { public boolean contains(final BinaryString s) { ensureMaterialized(); s.ensureMaterialized(); if (s.sizeInBytes == 0) { return true; } int find = SegmentsUtil.find( segments, offset, sizeInBytes, s.segments, s.offset, s.sizeInBytes); return find != -1; } BinaryString(); private  BinaryString(MemorySegment[] segments, int offset, int sizeInBytes); private  BinaryString(String javaObject); private  BinaryString(MemorySegment[] segments, int offset, int sizeInBytes, String javaObject); }
BinaryString extends LazyBinaryFormat<String> implements Comparable<BinaryString> { public boolean contains(final BinaryString s) { ensureMaterialized(); s.ensureMaterialized(); if (s.sizeInBytes == 0) { return true; } int find = SegmentsUtil.find( segments, offset, sizeInBytes, s.segments, s.offset, s.sizeInBytes); return find != -1; } BinaryString(); private  BinaryString(MemorySegment[] segments, int offset, int sizeInBytes); private  BinaryString(String javaObject); private  BinaryString(MemorySegment[] segments, int offset, int sizeInBytes, String javaObject); static BinaryString fromAddress(
			MemorySegment[] segments, int offset, int numBytes); static BinaryString fromString(String str); static BinaryString fromBytes(byte[] bytes); static BinaryString fromBytes(byte[] bytes, int offset, int numBytes); static BinaryString blankString(int length); int numChars(); byte byteAt(int index); byte[] getBytes(); @Override boolean equals(Object o); @Override String toString(); @Override void materialize(); BinaryString copy(); @Override int compareTo(@Nonnull BinaryString other); BinaryString substring(int beginIndex, int endIndex); boolean contains(final BinaryString s); boolean startsWith(final BinaryString prefix); boolean endsWith(final BinaryString suffix); BinaryString trim(); int indexOf(BinaryString str, int fromIndex); BinaryString toUpperCase(); BinaryString toLowerCase(); }
BinaryString extends LazyBinaryFormat<String> implements Comparable<BinaryString> { public boolean contains(final BinaryString s) { ensureMaterialized(); s.ensureMaterialized(); if (s.sizeInBytes == 0) { return true; } int find = SegmentsUtil.find( segments, offset, sizeInBytes, s.segments, s.offset, s.sizeInBytes); return find != -1; } BinaryString(); private  BinaryString(MemorySegment[] segments, int offset, int sizeInBytes); private  BinaryString(String javaObject); private  BinaryString(MemorySegment[] segments, int offset, int sizeInBytes, String javaObject); static BinaryString fromAddress(
			MemorySegment[] segments, int offset, int numBytes); static BinaryString fromString(String str); static BinaryString fromBytes(byte[] bytes); static BinaryString fromBytes(byte[] bytes, int offset, int numBytes); static BinaryString blankString(int length); int numChars(); byte byteAt(int index); byte[] getBytes(); @Override boolean equals(Object o); @Override String toString(); @Override void materialize(); BinaryString copy(); @Override int compareTo(@Nonnull BinaryString other); BinaryString substring(int beginIndex, int endIndex); boolean contains(final BinaryString s); boolean startsWith(final BinaryString prefix); boolean endsWith(final BinaryString suffix); BinaryString trim(); int indexOf(BinaryString str, int fromIndex); BinaryString toUpperCase(); BinaryString toLowerCase(); static final BinaryString EMPTY_UTF8; }