PDF Functional Interfaces in Java: Fundamentals and Examples 1st Edition Ralph Lecessi (Lecessi Download
PDF Functional Interfaces in Java: Fundamentals and Examples 1st Edition Ralph Lecessi (Lecessi Download
com
https://textbookfull.com/product/functional-
interfaces-in-java-fundamentals-and-examples-1st-
edition-ralph-lecessi-lecessi/
https://textbookfull.com/product/microservices-patterns-with-examples-
in-java-1st-edition-chris-richardson/
textbookfull.com
https://textbookfull.com/product/microservices-patterns-with-examples-
in-java-1st-edition-chris-richardson-2/
textbookfull.com
https://textbookfull.com/product/her-dirty-mafia-men-at-work-7-1st-
edition-mika-lane/
textbookfull.com
Transdisciplinary Theory Practice and Education The Art of
Collaborative Research and Collective Learning Dena Fam
https://textbookfull.com/product/transdisciplinary-theory-practice-
and-education-the-art-of-collaborative-research-and-collective-
learning-dena-fam/
textbookfull.com
https://textbookfull.com/product/breast-diseases-an-evidence-based-
pocket-guide-guilherme-novita/
textbookfull.com
https://textbookfull.com/product/women-writing-the-neo-victorian-
novel-erotic-victorians-kathleen-renk/
textbookfull.com
https://textbookfull.com/product/hyphenations-of-capillary-
chromatography-with-mass-spectrometry-1st-edition-peter-q-tranchida-
editor/
textbookfull.com
https://textbookfull.com/product/gandhi-an-illustrated-biography-
first-u-s-edition-edition-gandhi/
textbookfull.com
Core Data By Tutorials Aaron Douglas
https://textbookfull.com/product/core-data-by-tutorials-aaron-douglas/
textbookfull.com
Functional
Interfaces
in Java
Fundamentals and Examples
—
Ralph Lecessi
Functional Interfaces
in Java
Fundamentals and Examples
Ralph Lecessi
Functional Interfaces in Java: Fundamentals and Examples
Ralph Lecessi
Kendall Park, NJ, USA
iii
Table of Contents
Chapter 3: Predicates��������������������������������������������������������������������������������������������� 45
Section 3.1: The java.util.function Package�������������������������������������������������������������������������������� 45
Section 3.2: The Predicate Interface������������������������������������������������������������������������������������������� 45
Section 3.3: Passing a Predicate to a Method����������������������������������������������������������������������������� 47
Section 3.4: Chains of Functional Interfaces������������������������������������������������������������������������������� 50
Section 3.5: Predicate Chaining Creates Complex Logical Expressions������������������������������������� 50
Section 3.5.1: Chains Involving the OR Operation����������������������������������������������������������������� 50
Section 3.5.2: Chains Involving the AND Operation��������������������������������������������������������������� 52
Section 3.5.3: Chains Involving the ! Operation��������������������������������������������������������������������� 53
Section 3.5.4: Using Predicate.isEqual���������������������������������������������������������������������������������� 54
Section 3.5.5: Using Predicate.not [JAVA 11]������������������������������������������������������������������������ 55
Section 3.6: Overriding Predicate Default Methods�������������������������������������������������������������������� 56
Section 3.7: Specializations of Predicates���������������������������������������������������������������������������������� 57
Section 3.8: Binary Predicates���������������������������������������������������������������������������������������������������� 59
PROJECT 3: Discount Dave���������������������������������������������������������������������������������������������������������� 59
Problem Statement���������������������������������������������������������������������������������������������������������������� 59
Solution��������������������������������������������������������������������������������������������������������������������������������� 60
Short Problems��������������������������������������������������������������������������������������������������������������������������� 67
Long Problems���������������������������������������������������������������������������������������������������������������������������� 67
Chapter 4: Functions���������������������������������������������������������������������������������������������� 69
Section 4.1: The Function Interface�������������������������������������������������������������������������������������������� 69
Section 4.2: Passing a Generic Function to a Method����������������������������������������������������������������� 70
Section 4.2.1: Passing a Function with Restricted or Known Type Parameters�������������������� 71
iv
Table of Contents
Chapter 5: Operators���������������������������������������������������������������������������������������������� 95
Section 5.1: The UnaryOperator Interface����������������������������������������������������������������������������������� 95
Section 5.2: Specializations of UnaryOperator���������������������������������������������������������������������������� 96
Section 5.2.1: Chains Involving UnaryOperator Specializations�������������������������������������������� 97
Section 5.3: The BinaryOperator Interface���������������������������������������������������������������������������������� 98
Section 5.4: Non-generic Specializations of BinaryOperator����������������������������������������������������� 99
PROJECT 5: Calculator�������������������������������������������������������������������������������������������������������������� 100
Problem Statement�������������������������������������������������������������������������������������������������������������� 100
Solution������������������������������������������������������������������������������������������������������������������������������� 100
Short Problems������������������������������������������������������������������������������������������������������������������������� 106
Long Problems�������������������������������������������������������������������������������������������������������������������������� 107
v
Table of Contents
Section 6.3: Using Consumers with println as the Terminal Operation������������������������������������� 112
Section 6.4: Non-generic Specializations of Consumers���������������������������������������������������������� 112
Section 6.5: The BiConsumer Interface������������������������������������������������������������������������������������� 114
Section 6.6: Specializations of BiConsumer������������������������������������������������������������������������������ 115
PROJECT 6: Bank Transactions������������������������������������������������������������������������������������������������� 116
Problem Statement�������������������������������������������������������������������������������������������������������������� 116
Solution������������������������������������������������������������������������������������������������������������������������������� 117
Short Problems������������������������������������������������������������������������������������������������������������������������� 128
Long Problems�������������������������������������������������������������������������������������������������������������������������� 129
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
ix
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Table of Contents
x
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 405
xi
About the Author
Ralph Lecessi is a software engineer with over 30 years’
professional programming experience in the aerospace,
telecommunications, and payment industries at companies
including Lockheed Martin, Alcatel-Lucent, AT&T, and
Northrop Grumman. He is currently lead embedded
software developer at TranSendIT, Inc in Mount Laurel,
New Jersey.
Ralph is also the author of JAVATM - The Beginnings—a
text on basic Java programming that includes many examples and diagrams.
Ralph is an adjunct professor of programming at Middlesex County College, where
he teaches basic and object-oriented programming in Java. He lives in South Brunswick,
New Jersey, with his wife and two children.
xiii
About the Technical Reviewer
Manuel Jordan Elera is an autodidactic developer and
researcher who enjoys learning new technologies for his
own experiments and creating new integrations. Manuel
won the 2010 Springy Award Community Champion and
Spring Champion 2013. In his little free time, he reads
the Bible and composes music on his guitar. Manuel is
known as dr_pompeii. He has tech-reviewed numerous
books for Apress, including Pro Spring, Fourth Edition
(2014); Practical Spring LDAP (2013); Pro JPA 2, Second
Edition (2013); and Pro Spring Security (2013). Read his
13 detailed tutorials about many Spring technologies, contact him through his blog at
www.manueljordanelera.blogspot.com, and follow him on his Twitter account,
@dr_pompeii.
xv
Foreword
Functional Interfaces in Java shows how to organize and simplify Java programs through
the use of functional interfaces.
Chapters 1 and 2 introduce functional interfaces and discuss their implementation
using lambda expressions.
Chapters 3 through 7 discuss the functional interfaces present in the java.util.
function package.
Chapters 8 through 15 show how to use functional interfaces to perform various
programming tasks.
The appendix discusses method references and how they can be used in the
implementation of functional interfaces.
The text presents each topic with detailed descriptions and many examples. Each
chapter also contains a project through which I will guide you step by step to the
solution. Each chapter also contains short homework problems which reinforce the
subject matter and longer assignments which utilize the current topic to solve a real-
world problem.
Knowledge of basic Java programming is needed to understand the examples in this
text. If you need a primer on basic Java, I recommend JAVATM- The Beginnings.
Here are some notes regarding the programming style used in this book:
All examples have been tested in Java 9, Java 10, and Java 11 unless otherwise noted.
I hope you enjoy reading Functional Interfaces in Java as much as I have enjoyed
writing it.
—Ralph Lecessi
xvii
CHAPTER 1
Functional Interfaces
Section 1.1: Interfaces in Java
In Java, an interface specifies one or more methods. The interface is a contract which
must be honored by all implementing classes. The interface defined in Listing 1-1
specifies methods method1 and method2.
interface I1
{
void method1();
String method2(String x);
}
Any class that implements an interface must provide implementations for all the
methods declared in the interface (or the class must be declared as abstract). Since the
class defined in Listing 1-2 provides implementations for both method1 and method2,
objects of class C1 can be instantiated.
class C1 implements I1
{
@Override
public void method1() {}
@Override
public String method2(String x) { return x; }
}
1
© Ralph Lecessi 2019
R. Lecessi, Functional Interfaces in Java, https://doi.org/10.1007/978-1-4842-4278-0_1
Chapter 1 Functional Interfaces
interface I2
{
String s = "I2";
static void method1()
{
System.out.println(s);
}
2
Chapter 1 Functional Interfaces
class C2 implements I2
{
@Override
public String method2(String x) { return x; }
}
class C3 implements I2 {}
class TestI2
{
public static void main(String[] args)
{
I2.method1();
I2 objC2 = new C2();
I2 objC3 = new C3();
System.out.println(objC2.method2("Hello"));
System.out.println(objC3.method2("World"));
}
}
PROGRAM OUTPUT:
I2
Hello
I2World
In Java 9, interfaces were allowed to have private methods. Private methods are
useful to call from default methods. The program in Listing 1-4 concatenates a random
integer between 0 and 99 to the string “Hello”. Interface I3 contains private method
getNumber which generates the integer. This method is called by default method M1.
import java.util.Random;
interface I3
{
private int getNumber() { return (new Random()).nextInt(100); }
default String M1(String s)
3
Chapter 1 Functional Interfaces
{
return s + getNumber();
}
}
class C4 implements I3
{
}
class TestI3
{
public static void main(String[] args)
{
I3 objC4 = new C4();
System.out.println(objC4.M1("Hello"));
}
}
PROGRAM OUTPUT:
Hello21
In Java 9, interfaces can also have private static methods. Since the static methods of
an interface can be called without creation of an implementing object, these methods
can only be called by public static methods defined in the interface.
Interface I4 in the following program defines public static method getName which
calls private static method getPrefix to add the prefix “Mr. ” or “Ms. ” based on gender.
The getName method can be called from the main method of class TestI4. The getPrefix
method can be called only from inside method getName.
interface I4
{
private static String getPrefix(String p)
{
return p.equals("male")? "Mr. " : "Ms. ";
}
public static String getName(String n, String p)
4
Chapter 1 Functional Interfaces
{
return getPrefix(p) + n;
}
}
class TestI4
{
public static void main(String[] args)
{
System.out.println(I4.getName("Smith", "female"));
System.out.println(I4.getName("Jones", "male"));
}
}
PROGRAM OUTPUT:
Ms. Smith
Mr. Jones
5
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Chapter 1 Functional Interfaces
Functional interfaces are ideal for defining a single problem or operation. In Java 8,
the API was enhanced to utilize functional interfaces. Many of the functional interfaces
can contain static and default methods, making them extendable by the user.
6
Chapter 1 Functional Interfaces
The program in Listing 1-9 provides both named class and anonymous class
implementations for functional interface StringProcessor.
PROGRAM OUTPUT:
Hello
HELLO
7
Chapter 1 Functional Interfaces
class Receipt
{
String item;
double price;
double discount;
double tax;
public Receipt(String i, double a, double d, double s)
{
item = i;
price = a;
discount = d;
tax = s;
}
public Receipt(Receipt r)
{
item = r.item;
price = r.price;
discount = r.discount;
tax = r.tax;
}
}
8
Chapter 1 Functional Interfaces
on price, discount, and tax, but allows implementing classes to override the calculation.
The default method calls private method getDiscounterPrice which applies the
discount to the price.
@FunctionalInterface
interface ReceiptPrinter
{
void print(Receipt receipt);
9
Chapter 1 Functional Interfaces
The following ReceiptPrinter implementation is for merchants who are exempt from
tax. It provides its own implementation of the total calculation which does not include tax.
OUTPUT:
Item : shirt
Amount: 20.0
Disc: 0.05
Tax: 0.07
Total: 20.33
Item : shirt
Amount: 20.0
Disc: 0.05
Total: 19.0
10
Random documents with unrelated
content Scribd suggests to you:
Clancy was!
Raising her long lashes suddenly, she met his ardent, passionate, yet
respectful gaze.
Both pair of eyes sought the floor simultaneously; and it would have
been no easy task for one to have determined which face flushed
the deepest—the maiden’s or her lover’s; for Clancy Vere knew he
did love Vinnie Darke with all his heart.
Darke had not noticed this little by-play, and he asked, suddenly, as
the pretty air-castles both had been rearing up vanished as air
castles are wont to do when they are rudely jarred:
“How long do you think you were at the cavern before your
consciousness returned?”
“Yes; but he did not himself carry me to the cave. It was more than
a mile away that he found me; and although he is very strong, he
could not lug me on his back all that distance. When consciousness
returned he told me about it. Alonphilus the dwarf conveyed me to
the cave.”
“Oh, Leander told me all about that, too. I was brought on a horse
—”
“Yes.”
“You were rolled up from head to foot in a heavy black cloth, were
you not?” Darke went on, eagerly.
Had he been armed he would not have left the vicinity without first
attempting the life of the man who had him in his power and who
held his very life at his disposal; but he was powerless, having no
weapons except a short, sharp-pointed knife which he always carried
in addition to his hunting-knife, and this would be useless, except in
a hand-to-hand conflict, which even in his wild passion he had not
the hardihood to dare.
“How is the Forest Rose to-night?” the chief asked, glancing toward
a couch of skins and blankets on the opposite side of the lodge, on
which he could see the form of a female reclining by the dim fire-
light that illuminated the wigwam. She lay silent and motionless as
though life had fled.
“The Forest Rose is very ill,” replied the old Indian, mournfully, “and
she will die! Yon-da-do, the great medicine man, has said so. He has
made use of all his ceremonies and mystic arts, but he can not save
her. The lovely Forest Rose must die!”
“Would she come?” asked the old Indian, while a hopeful light
flashed out of his aged eyes, undimmed by the flight of time. “Would
a white medicine-woman come to give life back to an Indian girl!”
“She would not come willingly,” said the crafty chief, “but she must
be brought! If she is not, the Forest Rose will die!”
“Then she must be brought!” said the old Indian, decisively. “I will
call a council of braves in the morning, and a party shall be sent to
bring the white magician. The Forest Rose must be saved!”
The aged Indian was the real chief of the tribe—that is, although he
was too old to go on the war-path, leaving the active fighting to the
younger and more warlike Ku-nan-gu-no-nah, he was the real
moving spirit, always planning and ordering all important
movements of the band. The languishing Forest Rose was his
daughter.
“The great medicine-woman will save the Forest Rose, and again she
will sing like the birds in the trees to gladden the heart of her father,
the great chief.”
Wild Buffalo, the aged sachem, called a council of braves early in the
morning, and at midday, the subtle Ku-nan-gu-no-nah, at the head
of a dozen picked warriors, was riding over the prairie in quest of
“Sun-Hair,” the beautiful magician.
78
CHAPTER XIII.
THE FACE AT THE WINDOW.
“True,” said her father; “we are still in the dark concerning that. How
could it have been accomplished?”
“It was doubtless owing to some peculiar turn of the path he was
following, or something of that sort,” reasoned the woodman. “A
very sudden turn among the dense growth of shrubbery that is so
thick about the place might have concealed the white horse and his
rider from view almost instantly.”
“There is still another story of peril and escape that you are yet to
hear. I believe I will take a short bout in the forest in search of a
turkey; and if I am successful we’ll have a supper fit for the
President. Vinnie can tell you the story while I am gone. Be sure you
don’t leave out any of the important points, and don’t forget to
mention your lover’s visit yesterday. A truthful account of the
shocking manner in which you treated him ought to be a 79
caution to sparks! If I was a young fellow, now—”
“There now! stop!” said Vinnie, with a vivid blush. “I think you’re
really too bad! And besides, you are not fit to go out to-day, after
your hurt, and—”
“There,” said he, as he bent and pressed his lips to hers. “Good-by,
little one. And, Clancy, I want you to see that no one repeats this
operation during my absence. She’s all I’ve got, and I leave her in
your care. Don’t forget the story, Vinnie!” And a moment later he
passed out, closely followed by the blood-hound. Vinnie seized hold
of one of the great brute’s long ears, and bending low over him, to
hide her flushed face from Clancy’s view, said, playfully:
“There, Death, don’t run away from him as you did from me
yesterday!”
Then, while the young hunter thought she was putting herself to a
great deal of useless trouble, considering that the room was very
warm already, she went and busied herself at the hearth, for what
seemed to him a very long time, stirring the fire and putting on more
wood.
“What story does your father mean?” he asked, when she had at last
finished. “I thought from what you said that you saw the dwarf
when he was carrying me to the cave. It can not be that you were
out in that terrible storm?”
“But I was,” said Vinnie, with a smile, “and I half think I was the
victim of almost as serious a series of accidents as yourself. Papa
told me to tell you the story, and I suppose I must obey. Are you
sure it will be of interest to you?”
“If you had not, I would not now account my life worth as much as a
burnt charge of powder!”
Vinnie glanced up at him quickly, but her long lashes drooped as she
met his ardent look.
“I love you, Vinnie Darke, as I can never love another woman in the
whole world! I ask for your love in return. Can you—will you give it
to me, Vinnie darling?”
I am afraid if the woodman could have seen the little episode that
was taking place in the cabin then, he would have thought Clancy
just the least bit forgetful of the injunction he had put upon him
when he went away—of course he would not willfully ignore it!
“Yes.”
Again that dark face peered into the room a moment and then
vanished as it had done before.
Darke had been gone but a little while from the cabin, before he was
startled by the report of fire-arms, and the shrill war-whoop of the
band of Indians who, under the leadership of the wily Ku-nan-gu-no-
nah, had been sent out to capture Vinnie and bring her to the relief
of the suffering Forest Rose, who, although they knew it not, was
dead, having dropped quietly and peacefully away soon after they
left the encampment.
These sounds came from the direction of the cabin, and by a kind of
intuitive perception, he knew in an instant what was taking place
there.
He had just discharged his rifle at a fine turkey that the blood-hound
had come upon in a dense thicket; and reloading it as he ran, he
dashed with his utmost speed through the tangled 82
undergrowth and over fallen trees and heaps of half-decayed
brushwood back toward the scene of the conflict, which still
continued, as the sharp, oft-repeated reports of guns and the
appalling screeches of the Indians attested.
The terrible suspense and agony of mind that he suffered in the few
minutes that passed before he reached the edge of the clearing, it
would be impossible to depict. He knew that the young hunter was
as brave as a lion, and would not give up while life lasted; but he
judged from the steady and rapid fire kept up by the savages that
the odds against him were fearful.
“Heavens!” he cried, “the devils have forced the door! Nothing can
save them now! Their doom is sealed! Oh, Vinnie! Vinnie!”
Peering out, he discovered that the remaining Indian had set fire to
the cabin and was skulking around the other side, probably to get
out of range of his unerring rifle.
It was nearly dark now, but the settler fired again, and a bullet 83
went crashing through the savage’s brain, just as he had
almost gained the coveted shelter.
The fire was creeping up the side of the cabin, gaining ground
rapidly in the dry timber of which it was constructed. In a few
moments the whole building would be in a light blaze. An attempt to
extinguish the flames would, Darke saw, be fruitless.
There was no one to oppose his advance across the clearing since
he had slain the two savages left on the outside to fire the cabin and
guard against a surprise by any one from without, and closely
followed by Death, he dashed over the intervening space to the
open door of the cabin.
Looking within he saw, by the light of the fire blazing on the hearth,
that Clancy Vere was engaged in a desperate, hand-to-hand struggle
with three Indians. His back was against the wall, and with an
almost superhuman effort he forced them back and kept them at
bay with his clubbed rifle. Their guns were not loaded; but the
young hunter detected one of the trio in the act of charging his rifle,
while the two others vainly tried to get at him with their knives, and,
quickly whipping out his six-shooter, one chamber of which held a
leaden bullet that soon proved a quietus to this most dangerous of
his assailants, he discharged it and had only two enemies to contend
with.
The next moment the young hunter’s clubbed weapon fell with
deadly force upon the head of one of the Indians, crushing it like an
egg-shell, while at the same instant the other fell, pierced through
the brain by a ball from Darke’s unerring rifle.
Clancy had fought like a tiger, and though he had not been
dangerously wounded, he had not escaped unscathed. A bullet 84
fired through the window, before the Indians had forced an entrance
through the battered-down door of the cabin, had grazed his temple,
making an ugly though not dangerous furrow, and carrying away a
portion of his ear. The blood was trickling down his face, and
dropping upon the floor at his feet.
“Pardon me, boy,” said the woodman, extending his hand, which was
readily taken by Clancy. “I was mad! I did not mean what I said—
please forget it if you can. If we can not get her back, I believe I
shall go crazy!”
“Oh, we can get her back—we must!” cried the young hunter. “We
must get help and follow them and take her out of their hands or
die!”
“Because they are mounted. They left their horses at the edge of the
forest. It is scarcely three miles away. Before we could overtake
them they would be miles out on the prairie, riding at their horses’
best speed. We can do nothing alone, and horses are indispensable
—we must have them.”
“At the settlement. We can have every thing ready to-night and start
before daybreak.”
“Who do you think we had better get to go with us?” asked Darke.
“We must have good men.”
“I think we can do no better than to have Pete Wimple for one,” said
Clancy. “A truer and braver man can not be found in the North-west.”
“True,” said the woodman. “And the big hunter for another!”
“If we could only get him!” exclaimed Clancy.
“I’m sure he will go. He hates the Indians with an undying hatred,
and is glad of any opportunity to wreak his terrible vengeance on
them for the cold-blooded butchery of his aged parents.”
“Yes,” said the young hunter, “he told me his story. What a fiend
incarnate the chief is!”
“He led them,” said Clancy. “I think he instigated the attack to get
possession of Vinnie.”
“I think not. There will be four of us; and Pete Wimple and the giant
hunter will be a host in themselves.”
“We must make all our preparations to-night,” said Darke, “so as to
be far on our way at daylight.”
“It is fire!” replied Darke. “I saw one of the devils fire the cabin. It
must be all in a light blaze before this time!”
“Yes,” and the look on his face confirmed what he said, “I could do
any thing—brave any thing for her! There is nothing that I would not
attempt to save her from pain—nothing that I would not dare, to
make her happy! Vinnie is more to me than my life, Mr. Darke! To-
day, before those red devils came to tear her away from me, she
promised to become my wife.”
“I believe you, boy!” exclaimed Darke. “I could not intrust her to the
protecting love of a better man. If we can only save her she shall be
yours!”
“Thank you,” said the young man, earnestly. “We must save her from
that demon’s power! The thought that she is in his hands is
maddening! But we must act. I will go to the settlement and obtain
horses and enlist Pete Wimple in our cause, while you proceed to
the cave to secure the services of the big hunter. I’m sure he will not
refuse us his aid.”
“Near the big pine tree at the edge of the forest. We must be
mounted and on our way before daylight.”
The fire had caught in the great oak trees that had been left close
up by the walls of the woodman’s home as a partial protection
against wind and storm, and the flames, shooting heavenward, cast
a lurid glow over the dark forest for quite a distance in every
direction.
The two men hastened away, the burning cabin lighting their way
through the wood, Death, the blood-hound keeping close to 87
Darke and manifesting his sense of the calamity that had
overtaken them by giving utterance ever and anon to low, sorrowful
whines.
CHAPTER XV.
WHAT THE SCOUTS FOUND.
When the sun rose the next morning—for the day broke clear and
cloudless with a keen, frosty atmosphere—its rays fell on a heap of
smoldering ruins, encircled by a dozen charred trees burnt and
blackened to their very tops. This was all that remained of Emmett
Darke’s cabin home.
The four men, Darke, Clancy Vere, Leander Maybob, the giant
hunter, and Pete Wimple, a tried and trusty scout and Indian-fighter,
were at the appointed place of rendezvous at a very early hour, and,
well mounted on four fleet, strong horses that Clancy and the scout
had obtained at the settlement, they were at daybreak dashing over
the smooth, level prairie in pursuit of Ku-nan-gu-no-nah and his
party.
For hours they kept on at a rapid, even gallop, which they neither
quickened nor slackened. Clancy and the scout, riding side by side
and keeping a sharp look-out ahead for any signs of the enemy,
while Darke and the giant hunter were ever on the alert to guard
against the approach of any hostile party from the rear.
None of the four had spoken more than a few words since they left
the big pine, hours before, even Leander Maybob, usually so
loquacious, maintaining a thoughtful and unbroken silence.
The day continued as it had dawned, clear and sun-shiny, the pure,
bracing air inspiring the little band to more than common vigilance
and alertness, while it added fresh vigor to their steeds, and they
kept on at the same quick, regular rate of speed until mid-day
without meeting with adventure of any kind.
Then Pete Wimple drew his horse up suddenly, and in 88
obedience to his low-spoken command, the three others
reined in their horses.
“I don’t know for sartin,” and the scout, shading his eyes with his
hand, looked long and earnestly across the wide, grassy plain before
them. Following the direction of his gaze, the others saw dimly in the
distance a thin blue cloud of smoke rising from the surface of the
prairie.
“Very likely,” said the scout. “I think as how it’s some-’eres ’long the
line of the emigrant trail. We’ll strike it purty quick—it’s jist ahead
thar—and we’ve got to foller it for severil hours. We’ve got to pass
that fire, and afore we get too cluss, I want to know what it means!”
The others could not restrain a laugh at this; and when their
merriment had subsided Darke asked:
“I agree with ye thar!” said the giant, “as Elder Tugwoller remarked
to my daddy when he expressed his opinion as how donations was a
good institution; but my name ain’t Low-lander.”
By the time they had prepared the noon-day meal, Clancy saw Darke
and Wimple coming back; and in less than ten minutes they 91
threw themselves from their horses a few rods away, and after
tethering them, came up with rapid strides.
“What did you find?” asked Clancy eagerly; “any signs of Vinnie or
her captors?”
“We found some of the devil’s own handiwork!” answered the scout,
a dark, fierce look on his usually pleasant face that the young hunter
never saw there before.
“The smoke we saw arises from two burning emigrant wagons that
the Indians have plundered and then set fire to!” said Darke. “One
man, evidently the guide, lay dead and scalped, his body, with those
of three savages who had been shot in the affray, half burned up in
the fire! The remainder of the party, which I should judge was not
very large, have either escaped or been made prisoners.”
“I’ve made up my mind to settle with him purty soon!” said Leander
Maybob, sternly. “His time’s most up!”
CHAPTER XVI.
THE PHANTOM RIDER!
Five minutes later the little party was on the move again.
At first, Leander Maybob took little part in the conversation and bent
his gaze anxiously every few minutes upon the horizon in the
direction whence they had come.
The scout thought not. The savages might be on the look-out for
some such movement as that, as they would probably expect 92
that an attempt would be made to rescue Vinnie, in which
case they would run great risk of falling into some trap set for them
by the Indians, if they approached the encampment boldly and in
the full glare of the sunlight. Their party was too small to hazard
being taken at so great a disadvantage. They dared not show
themselves openly in the camp of their enemies. The odds would be
too great against them.
“No!” said Wimple, emphatically. “We mustn’t try such a plan as that.
It would be worse than useless! What we do must be done by
stratagem. There’s a steep bluff, only ’tain’t a bluff, neither—thar
ain’t no river under it—jist back of the Injin camp. This hill’s all
grown over with low scrub-oak and other stuff so thick ye can’t see
a rod any way. If we could only git up there and hide till arter dark,
and then two or three of us jist step quietly down and release the
prisoners, leaving some one to have the horses ready to mount at
an instant’s warnin’, I think we could git the gal cl’ar without much
blood-lettin’, and maybe the other prisoners, whoever they are. It’s
the best plan I can think of now.”
Darke agreed with the scout that nothing could be done by daylight,
but he was getting very impatient.
“I think,” said the big hunter, “as how ye’re partly right in yer
calkerlations and mayhap partly wrong. I don’t believe as how us
four rushing into the imps’ nest would do much good. We’d be very
likely to git our little lump of lead, every one on us, and that’d be the
end on’t all; but instid o’ climbin’ the hill, if ye’ll jist take the advice
of one who has fit Injins some, and stop in the border of the wood,
down level with the edge of the prairie, and wait and see what
happens, I b’lieve we can do suthin’ as ’ll amount to suthin’. I’ve
knowed some of the best kind of jobs to be did in gittin’ away
prisoners from the reds, jist by watchin’ and takin’ advantage of
accidents and the like. If you’ll all do jist as I say and not git
flustered or go to gittin’ away up there on top of the hill, I’ll promise
that every prisoner in the Indian camp shall be safe before sundown
—yes, in less than two hours. You don’t know what amazin’ helps
accidents is sometimes, in sich cases as this one!”
“Yes.”
“Thar’s no tellin’ exactly,” replied the big hunter. “A feller can’t most
always tell what is goin’ to take place. But I’m safe in guaranteein’
thirty or forty of them reds one of the tallest accidents in a little
while—’bout as soon as we can git to their camp—they ever had any
ijee of!”
“Yes,” cried all three with one voice. “You shall lead us!”
“I believe you can do what you say!” added Darke. “But remember
that a mistake on our part might prove fatal to Vinnie and the
others!”
“Here we are,” said Leander Maybob, throwing himself off his horse.
“Jist git off yer nags and stretch yerselves a little, while I take a look
outside. Make the most outen your restin’-spell, for I can tell yer that
ye won’t have long to lay idle. I’m expectin’ an accident soon!”
And with these strange words which the three men were assured
held more meaning than they expressed, the giant strode 94
away and disappeared from view among the shrubbery. In less
than five minutes he came back, and his face showed that the result
of his reconnoissance was satisfactory.
“I’ve got a six-shooter and a rifle, both loaded,” said the scout.
“And I’ve got two revolvers and a rifle,” said the scout.
The big hunter’s prompt manner and cool, baffling way of talking
had inspired the three men with the utmost confidence in himself
and his power to bring their enterprise to a successful termination,
and they obeyed his orders implicitly. In a moment they were
mounted, their unerring rifles ready for use at a moment’s warning.
Just then the giant came running through the chapparal, and hastily
seizing his ride, which he had left standing against a tree, threw
himself upon the back of his horse and rode to the head of the little
band of wondering, anxious men.
There was a moment of dead silence, the four men almost holding
their breath in their suspense.
Then a shriek rung out on the air—a shriek that was half a wail, half
a curse—so weird and so unearthly that for a moment the blood
seemed to stand still in the veins of the three startled men.
“Now’s our time!” cried the big hunter. “Shoot down every red-skin
you see! But don’t harm a hair of Ku-nan-gu-no-nah’s head if you
can help it! Take him alive!!”
As they cleared the chapparal, they saw a sight for which even the
terrible cry of a moment before had not prepared them.