|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.entry.Enumerator | +--sam.entry.List
Static enumerator.
Can be reset.
reset
Field Summary |
Fields inherited from class sam.entry.Enumerator |
EMPTY |
Constructor Summary | |
|
List(sam.entry.Entry[] entries)
Makes a list from specified entries array. |
protected |
List(sam.entry.Entry[] entries,
int start,
int end)
Makes a list from specified entries array portion. |
|
List(java.io.InputStream input)
Make a list from file names list read from an input stream. |
|
List(java.lang.String[] names)
Make a list from file names list. |
Method Summary | |
sam.entry.Enumerator |
appendNewerFrom(sam.entry.List others)
Appends all newer entries to this enumeration. |
void |
checkRead()
Check all entries of this enumeration for reading. |
int |
count()
Counts the total number of remaining entries in this enumeration. |
sam.entry.Enumerator |
exclude(sam.entry.Enumerator others)
Excludes specified entries from current list. |
sam.entry.Enumerator |
getRemovedSince(sam.entry.Enumerator others)
Returns the enumeration of all entries appearing in other but not in this . |
boolean |
hasMoreElements()
Wether this Enumerator has more elements |
boolean |
isEmpty()
Tests wether all included entries are of length 0, or if there is no more entry at all. |
sam.entry.Enumerator |
keepNewerThan(sam.entry.Enumerator others)
Keeps only entries from this enumeration that are newer than in specified enumeration. |
sam.entry.Entry |
nextEntry()
Gets next entry, or null if none |
protected sam.entry.List |
removeDuplicates(java.util.Comparator comparator)
Removes duplicate entries from a sorted files list. |
sam.entry.List |
removeDuplicates(sam.entry.NameFilter filter)
Removes duplicates file specification. |
void |
reset()
Restarts the enumeration from the beginning |
long |
size()
Computes the total size of all entries of this enumeration. |
sam.entry.List |
sort()
Sorts this enumeration in lexicographical order. |
sam.entry.List |
sort(java.util.Comparator comparator)
Sorts this enumeration. |
sam.entry.List |
sortAndRemoveDuplicates()
|
sam.entry.List |
sortAndRemoveDuplicates(java.util.Comparator comparator)
Sorts and remove duplicates in a sorted files list. |
boolean |
specifies(sam.entry.Entry entry)
Tests this regular expression against specified entry |
boolean |
specifies(sam.entry.Entry entry,
sam.entry.NameFilter filter)
Tests this regular expression against specified entry |
java.lang.String |
toString()
|
Methods inherited from class sam.entry.Enumerator |
filter, filter, load, nextElement, println, println, statify, store |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public List(java.io.InputStream input) throws java.io.IOException
public List(java.lang.String[] names)
public List(sam.entry.Entry[] entries)
protected List(sam.entry.Entry[] entries, int start, int end)
Method Detail |
public sam.entry.Entry nextEntry()
Enumerator
null
if none
nextEntry
in class Enumerator
public boolean hasMoreElements()
Enumerator
Enumerator
has more elements
hasMoreElements
in interface java.util.Enumeration
hasMoreElements
in class Enumerator
public long size()
public int count()
public void checkRead() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public void reset()
public boolean isEmpty()
isEmpty
in class Enumerator
public sam.entry.Enumerator keepNewerThan(sam.entry.Enumerator others)
public sam.entry.Enumerator exclude(sam.entry.Enumerator others)
public sam.entry.Enumerator getRemovedSince(sam.entry.Enumerator others)
other
but not in this
.
public sam.entry.Enumerator appendNewerFrom(sam.entry.List others)
public sam.entry.List sort()
this
(Beware !)public sam.entry.List sort(java.util.Comparator comparator)
this
(Beware !)public sam.entry.List sortAndRemoveDuplicates()
public sam.entry.List sortAndRemoveDuplicates(java.util.Comparator comparator)
The complexity is that of sorting, i.e. n*ln(n)
.
List
instance with duplicates removed.protected sam.entry.List removeDuplicates(java.util.Comparator comparator)
The complexity is linear, because any entry has to be compared to the only adjacent one for equality.
comparator
- the files comparator to be used for ordering and equality testing.
List
instance with duplicates removed.
java.lang.IllegalArgumentException
- if this list is not sorted.NameFilter
public sam.entry.List removeDuplicates(sam.entry.NameFilter filter)
Reduces { "a*", "?", "*" }
to { "*", "?" }
The complexity is quadratic, because any entry has to be compared to all others.
filter
- the name filter to be used. Default is NameFilter.BASIC
List
instance with duplicates removed.NameFilter
public boolean specifies(sam.entry.Entry entry)
true
if, and only if at least one of these entries is a regular expression
that expands to entry
public boolean specifies(sam.entry.Entry entry, sam.entry.NameFilter filter)
filter
- the name filtering rule to be used
true
if, and only if at least one of these entries is a regular expression
that expands to entry
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |