|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<String>
de.schlichtherle.truezip.util.CanonicalStringSet
de.schlichtherle.truezip.util.SuffixSet
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class SuffixSet
An ordered set of canonicalized suffixes.
A SuffixSet can be converted into a string representation by
calling CanonicalStringSet.toString().
A suffix is the part of a file name string after the last dot.
It must not contain the character '|'.
A suffix in canonical form (or canonical suffix for short) is a
lowercase string which is not empty and does not start with a
dot ('.').
For example, the suffix "zip" is in canonical form,
while the suffixes
"",
"Zip",
"ZIP",
".zip",
".Zip",
".ZIP", and
"zip|Zip|ZIP|.zip|.Zip|.ZIP" aren't.
A suffix list is a string which consists of zero or more suffixes
which are separated by the character '|'.
Note that in general, a suffix list is just a sequence of suffixes.
In particular, a suffix list may be empty (but not null) and
its suffixes don't have to be in canonical form, may be duplicated in the
list and may appear in arbitrary order.
Suffix lists have a canonical form, too: A suffix list in canonical form (or canonical suffix list for short) is a suffix list which contains only canonical suffixes in natural sort order and does not contain any duplicates (so it's actually a set).
A suffix list can be canonicalized using this class by calling
new SuffixSet(list).toString().
Unless otherwise documented, all Set methods work on the
canonical form of the suffixes in this set.
Null suffixes are not permitted in this set.
| Nested Class Summary | |
|---|---|
private static class |
SuffixSet.SuffixMapper
A canonicalizer for file suffixes. |
| Nested classes/interfaces inherited from class de.schlichtherle.truezip.util.CanonicalStringSet |
|---|
CanonicalStringSet.Canonicalizer |
| Field Summary | |
|---|---|
static char |
PREFIX
The optional prefix for suffixes, which is 46. |
static char |
SEPARATOR
The separator for suffixes in lists, which is 124. |
| Constructor Summary | |
|---|---|
SuffixSet()
Constructs a new, empty suffix set. |
|
SuffixSet(Collection<String> c)
Constructs a new suffix set by adding the canonical form of all suffixes for all suffix lists in the given collection. |
|
SuffixSet(String suffixes)
Constructs a new suffix set from the given suffix list. |
|
| Method Summary | |
|---|---|
Pattern |
toPattern()
Returns a case insensitive regular expression to match (file) paths against the suffixes in this set. |
| Methods inherited from class de.schlichtherle.truezip.util.CanonicalStringSet |
|---|
add, addAll, addAll, clear, contains, containsAll, containsAll, isEmpty, iterator, remove, removeAll, removeAll, retainAll, retainAll, size, toArray, toArray, toString |
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode, removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, containsAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
addAll, containsAll, retainAll |
| Field Detail |
|---|
public static final char SEPARATOR
public static final char PREFIX
| Constructor Detail |
|---|
public SuffixSet()
public SuffixSet(String suffixes)
suffixes - A list of suffixes.public SuffixSet(Collection<String> c)
c - A collection of suffix lists.| Method Detail |
|---|
public Pattern toPattern()
|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||