/** Returns a synchronized string map backed by the given string map. * * @param stringMap the string map to be wrapped in a synchronized map. * @return a synchronized view of the specified string map. */ public static <T extends CharSequence> StringMap<T> synchronize( final StringMap<T> stringMap ) { return stringMap instanceof PrefixMap ? new SynchronizedPrefixMap<T>( (PrefixMap<T>)stringMap ) : new SynchronizedStringMap<T>( stringMap ); }
public void add( final int index, final long k ) { ensureIndex( index ); l.add( from + index, k ); to++; if ( ASSERTS ) assertRange(); }
public long removeLong( long index ) { ensureRestrictedIndex( index ); to--; return l.removeLong( from + index ); }
/** Copies the content of the buffer to an array. * * @param b the buffer where the content is to be copied. */ public void toCharArray( char[] b ) { toCharArray( b, 0, b.length ); }
/** An alias for {@link #length()}. * @return the interval length. */ public int size() { return length(); }
public IntSortedSet tailSet( final int from ) { if ( this == EMPTY_INTERVAL ) return this; if ( from <= right ) return from <= left ? this : valueOf( from, right ); else return EMPTY_INTERVAL; }
/** Returns the index of the first occurrence of this pattern in the given character array starting from a given index. * * @param array the character array to look in. * @param from the index from which the search must start. * @return the index of the first occurrence of this pattern contained in the * subarray starting from <code>from</code> (inclusive), or * <code>-1</code>, if the pattern cannot be found. */ public int search( char[] array, int from ) { return search( array, from, array.length ); }
/** Returns the element at the specified position in this front-coded list by storing it in a mutable string. * * @param index an index in the list. * @param s a mutable string that will contain the string at the specified position. */ public void get( final int index, final MutableString s ) { frontCodedStringList.get( permutation[ index ], s ); }
public long getLong( long index ) { ensureRestrictedIndex( index ); return l.getLong( from + index ); }
public long set( int index, long k ) { ensureRestrictedIndex( index ); return l.set( from + index, k ); }
/** Returns a one-point interval. * * <P>You cannot obtain an empty interval with this factory method. Use {@link Intervals#EMPTY_INTERVAL} instead. * * @param point a point. * @return a one-point interval */ public static Interval valueOf( final int point ) { if ( point >= 0 && point < MAX_SINGLE_POINT ) return POINT_INTERVAL[ point ]; return new Interval( point, point ); }
/** Returns a synchronized string map backed by the given string map. * * @param stringMap the string map to be wrapped in a synchronized map. * @return a synchronized view of the specified string map. */ public static <T extends CharSequence> StringMap<T> synchronize(final StringMap<T> stringMap) { return stringMap instanceof PrefixMap ? new SynchronizedPrefixMap<>((PrefixMap<T>)stringMap) : new SynchronizedStringMap<>(stringMap); }
/** Returns the index of the first occurrence of this pattern in the given byte array. * * @param a the byte array to look in. * @return the index of the first occurrence of this pattern contained in the * given byte array, or <code>-1</code>, if the pattern cannot be found. */ public int search( final byte[] a ) { return search( a, 0, a.length ); }
public void add( final int index, final long k ) { ensureIndex( index ); l.add( from + index, k ); to++; if ( ASSERTS ) assertRange(); }
public long removeLong( long index ) { ensureRestrictedIndex( index ); to--; return l.removeLong( from + index ); }
public long getLong( long index ) { ensureRestrictedIndex( index ); return l.getLong( from + index ); }
public long set( int index, long k ) { ensureRestrictedIndex( index ); return l.set( from + index, k ); }
/** Returns a synchronized string map backed by the given string map. * * @param stringMap the string map to be wrapped in a synchronized map. * @return a synchronized view of the specified string map. */ public static <T extends CharSequence> StringMap<T> synchronize( final StringMap<T> stringMap ) { return stringMap instanceof PrefixMap ? new SynchronizedPrefixMap<T>( (PrefixMap<T>)stringMap ) : new SynchronizedStringMap<T>( stringMap ); }