public class InternedMutableStringSet extends it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<MutableString>
This class extends ObjectOpenHashSet
by
providing an intern(MutableString)
method with a semantics similar to
that of String.intern()
.
Modifier and Type | Class and Description |
---|---|
static class |
InternedMutableStringSet.Term |
Constructor and Description |
---|
InternedMutableStringSet() |
InternedMutableStringSet(int n) |
InternedMutableStringSet(int n,
float f) |
Modifier and Type | Method and Description |
---|---|
InternedMutableStringSet.Term |
intern(MutableString s)
Returns an interned, canonical copy contained in this set of the specified mutable string.
|
add, clear, clone, contains, get, growthFactor, growthFactor, hashCode, isEmpty, iterator, rehash, rehash, remove, shiftKeys, size, trim, trim
addAll, containsAll, objectIterator, removeAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public InternedMutableStringSet()
public InternedMutableStringSet(int n, float f)
public InternedMutableStringSet(int n)
public InternedMutableStringSet.Term intern(MutableString s)
The semantics of this method is essentially the same as that of
Collection.add(Object)
, but
this method will return a mutable string
equal to s
currently in this set. The string will
never be s
, as in the case s
is
not in this set a compact copy
of s
will be stored instead.
The purpose of this method is similar to that of String.intern()
,
but obviously here the user has much greater control.
s
- the mutable string that must be interned.s
stored in this set.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.