554 lines
33 KiB
HTML
554 lines
33 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (version 1.7.0_51) on Wed Apr 06 13:11:06 EDT 2016 -->
|
|
<title>TextDirectorySource (Parallel Java 2 Library Documentation)</title>
|
|
<meta name="date" content="2016-04-06">
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="TextDirectorySource (Parallel Java 2 Library Documentation)";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar_top">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/TextDirectorySource.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../edu/rit/pjmr/SourceConfig.html" title="class in edu.rit.pjmr"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/pjmr/TextFileSource.html" title="class in edu.rit.pjmr"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?edu/rit/pjmr/TextDirectorySource.html" target="_top">Frames</a></li>
|
|
<li><a href="TextDirectorySource.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">edu.rit.pjmr</div>
|
|
<h2 title="Class TextDirectorySource" class="title">Class TextDirectorySource</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>edu.rit.pjmr.TextDirectorySource</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<dl>
|
|
<dt>All Implemented Interfaces:</dt>
|
|
<dd><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a>, <a href="../../../edu/rit/pjmr/Source.html" title="interface in edu.rit.pjmr">Source</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></dd>
|
|
</dl>
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">TextDirectorySource</span>
|
|
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
|
|
implements <a href="../../../edu/rit/pjmr/Source.html" title="interface in edu.rit.pjmr">Source</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></pre>
|
|
<div class="block">Class TextDirectorySource provides a data source that obtains data records
|
|
from multiple files in a directory. Each file is assumed to contain plain
|
|
text. Each line of each file constitutes one data record. The data record ID
|
|
consists of the file and the line number (type <a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>). The data
|
|
record contents is the line itself (type <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>), excluding any line separator at the end.
|
|
<P>
|
|
Conceptually, a text directory source concatenates together all the files in
|
|
a given directory whose file names match a given pattern. The default is to
|
|
match every file in the directory. The text directory source feeds out the
|
|
lines of the concatenated files. The order in which the files are
|
|
concatenated is not specified. If multiple mapper objects are obtaining data
|
|
records from the same text directory source, the particular mapper object
|
|
that receives each data record is not specified; the lines of one file might
|
|
not all go to the same mapper.
|
|
<P>
|
|
Normally, it is not considered an error if the given directory does not
|
|
contain any files whose names match the given pattern; in this case, the
|
|
<a href="../../../edu/rit/pjmr/TextDirectorySource.html#open()"><code>open()</code></a> method will succeed and the <a href="../../../edu/rit/pjmr/TextDirectorySource.html#next(int)"><code>next()</code></a>
|
|
method will return null. If the lack of any matching file names <I>is</I> to
|
|
be considered an error, call the <a href="../../../edu/rit/pjmr/TextDirectorySource.html#noMatchIsError(boolean)"><code>noMatchIsError()</code></a> method after constructing the text directory source object;
|
|
then the <a href="../../../edu/rit/pjmr/TextDirectorySource.html#open()"><code>open()</code></a> method will throw an exception in this case.
|
|
<P>
|
|
<I>Note:</I> Class TextDirectorySource is multiple thread safe.</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colOne" scope="col">Constructor and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource()">TextDirectorySource</a></strong>()</code>
|
|
<div class="block">Construct a new uninitialized text directory source.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource(java.io.File)">TextDirectorySource</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</code>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource(java.io.File, java.util.regex.Pattern)">TextDirectorySource</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true" title="class or interface in java.util.regex">Pattern</a> pattern)</code>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory whose names match the given pattern.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource(java.io.File, java.lang.String)">TextDirectorySource</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> patternString)</code>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory whose names match the given pattern string.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource(java.lang.String)">TextDirectorySource</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> directoryName)</code>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory name.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource(java.lang.String, java.util.regex.Pattern)">TextDirectorySource</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> directoryName,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true" title="class or interface in java.util.regex">Pattern</a> pattern)</code>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory name whose names match the given pattern.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#TextDirectorySource(java.lang.String, java.lang.String)">TextDirectorySource</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> directoryName,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> patternString)</code>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory name whose names match the given pattern string.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#close()">close</a></strong>()</code>
|
|
<div class="block">Close this data source.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#next(int)">next</a></strong>(int id)</code>
|
|
<div class="block">Get the next data record from this data source.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../edu/rit/pjmr/TextDirectorySource.html" title="class in edu.rit.pjmr">TextDirectorySource</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#noMatchIsError(boolean)">noMatchIsError</a></strong>(boolean err)</code>
|
|
<div class="block">Specify whether the lack of any files whose names match the given pattern
|
|
is to be considered an error.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#open()">open</a></strong>()</code>
|
|
<div class="block">Open this data source.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#readIn(edu.rit.io.InStream)">readIn</a></strong>(<a href="../../../edu/rit/io/InStream.html" title="class in edu.rit.io">InStream</a> in)</code>
|
|
<div class="block">Read this data source from the given in stream.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../edu/rit/pjmr/TextDirectorySource.html#writeOut(edu.rit.io.OutStream)">writeOut</a></strong>(<a href="../../../edu/rit/io/OutStream.html" title="class in edu.rit.io">OutStream</a> out)</code>
|
|
<div class="block">Write this data source to the given out stream.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
|
|
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a name="TextDirectorySource()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource()</pre>
|
|
<div class="block">Construct a new uninitialized text directory source. This constructor is
|
|
for use only by object deserialization.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="TextDirectorySource(java.lang.String)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> directoryName)</pre>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory name.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryName</code> - Directory name.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>directoryName</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TextDirectorySource(java.io.File)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory)</pre>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - Directory.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>directory</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TextDirectorySource(java.lang.String, java.lang.String)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> directoryName,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> patternString)</pre>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory name whose names match the given pattern string.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryName</code> - Directory name.</dd><dd><code>patternString</code> - Pattern string for file names, in the syntax of
|
|
class <a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true" title="class or interface in java.util.regex">Pattern</a>.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>directoryName</TT> is null.
|
|
Thrown if <TT>patternString</TT> is null.</dd>
|
|
<dd><code>PatternSyntaxException</code> - (unchecked exception) Thrown if <TT>patternString</TT> does not obey
|
|
the legal pattern syntax.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TextDirectorySource(java.io.File, java.lang.String)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> patternString)</pre>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory whose names match the given pattern string.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - Directory.</dd><dd><code>patternString</code> - Pattern string for file names, in the syntax of
|
|
class <a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true" title="class or interface in java.util.regex">Pattern</a>.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>directory</TT> is null. Thrown if
|
|
<TT>patternString</TT> is null.</dd>
|
|
<dd><code>PatternSyntaxException</code> - (unchecked exception) Thrown if <TT>patternString</TT> does not obey
|
|
the legal pattern syntax.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TextDirectorySource(java.lang.String, java.util.regex.Pattern)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> directoryName,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true" title="class or interface in java.util.regex">Pattern</a> pattern)</pre>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory name whose names match the given pattern.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryName</code> - Directory name.</dd><dd><code>pattern</code> - Pattern for file names.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>directoryName</TT> is null.
|
|
Thrown if <TT>pattern</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TextDirectorySource(java.io.File, java.util.regex.Pattern)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>TextDirectorySource</h4>
|
|
<pre>public TextDirectorySource(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a> directory,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true" title="class or interface in java.util.regex">Pattern</a> pattern)</pre>
|
|
<div class="block">Construct a new text directory source that will read all files in the
|
|
given directory whose names match the given pattern.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - Directory.</dd><dd><code>pattern</code> - Pattern for file names.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - (unchecked exception) Thrown if <TT>directory</TT> is null. Thrown if
|
|
<TT>pattern</TT> is null.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method_detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="open()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>open</h4>
|
|
<pre>public void open()
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Open this data source.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/pjmr/Source.html#open()">open</a></code> in interface <code><a href="../../../edu/rit/pjmr/Source.html" title="interface in edu.rit.pjmr">Source</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred. Thrown if <a href="../../../edu/rit/pjmr/TextDirectorySource.html#noMatchIsError(boolean)"><code>noMatchIsError()</code></a> has been set to true and
|
|
the given directory does not contain any files whose names match the
|
|
given pattern.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="next(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>next</h4>
|
|
<pre>public <a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> next(int id)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Get the next data record from this data source. The data record is being
|
|
requested by the mapper with the given ID. The data record is a
|
|
<a href="../../../edu/rit/util/Pair.html" title="class in edu.rit.util">Pair</a> containing a data record ID and the data record
|
|
contents.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/pjmr/Source.html#next(int)">next</a></code> in interface <code><a href="../../../edu/rit/pjmr/Source.html" title="interface in edu.rit.pjmr">Source</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>id</code> - Mapper ID (ignored).</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>Data record, or null if there are no more.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="close()">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>close</h4>
|
|
<pre>public void close()
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Close this data source.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/pjmr/Source.html#close()">close</a></code> in interface <code><a href="../../../edu/rit/pjmr/Source.html" title="interface in edu.rit.pjmr">Source</a><<a href="../../../edu/rit/pjmr/TextId.html" title="class in edu.rit.pjmr">TextId</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="writeOut(edu.rit.io.OutStream)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>writeOut</h4>
|
|
<pre>public void writeOut(<a href="../../../edu/rit/io/OutStream.html" title="class in edu.rit.io">OutStream</a> out)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Write this data source to the given out stream.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/io/Streamable.html#writeOut(edu.rit.io.OutStream)">writeOut</a></code> in interface <code><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>out</code> - Out stream.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="readIn(edu.rit.io.InStream)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>readIn</h4>
|
|
<pre>public void readIn(<a href="../../../edu/rit/io/InStream.html" title="class in edu.rit.io">InStream</a> in)
|
|
throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
|
|
<div class="block">Read this data source from the given in stream.</div>
|
|
<dl>
|
|
<dt><strong>Specified by:</strong></dt>
|
|
<dd><code><a href="../../../edu/rit/io/Streamable.html#readIn(edu.rit.io.InStream)">readIn</a></code> in interface <code><a href="../../../edu/rit/io/Streamable.html" title="interface in edu.rit.io">Streamable</a></code></dd>
|
|
<dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - In stream.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - Thrown if an I/O error occurred.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
<a name="noMatchIsError(boolean)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>noMatchIsError</h4>
|
|
<pre>public <a href="../../../edu/rit/pjmr/TextDirectorySource.html" title="class in edu.rit.pjmr">TextDirectorySource</a> noMatchIsError(boolean err)</pre>
|
|
<div class="block">Specify whether the lack of any files whose names match the given pattern
|
|
is to be considered an error. The default is false.</div>
|
|
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>err</code> - True if this situation is an error, false if it isn't.</dd>
|
|
<dt><span class="strong">Returns:</span></dt><dd>This text directory source object.</dd></dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a name="navbar_bottom">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/TextDirectorySource.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../index-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../edu/rit/pjmr/SourceConfig.html" title="class in edu.rit.pjmr"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../edu/rit/pjmr/TextFileSource.html" title="class in edu.rit.pjmr"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?edu/rit/pjmr/TextDirectorySource.html" target="_top">Frames</a></li>
|
|
<li><a href="TextDirectorySource.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_summary">Constr</a> | </li>
|
|
<li><a href="#method_summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor_detail">Constr</a> | </li>
|
|
<li><a href="#method_detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip-navbar_bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
<p class="legalCopy"><small><FONT SIZE="-2">Copyright © 2013–2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">@</FONT><FONT SIZE="1" COLOR="#FFFFFF">­</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
|
|
</body>
|
|
</html>
|