Java
project_4/build/built-jar.properties
#Mon, 10 Apr 2017 11:59:24 +0300 C\:\\Users\\JAHGUY\\Documents\\NetBeansProjects\\project_4=
project_4/build/classes/project4/HelpLists.class
package project4; public synchronized class HelpLists { public void HelpLists(); public void reverse(RecLinkedList); public void FIFO(RecLinkedList); }
project_4/build/classes/project4/Main.class
package project4; public synchronized class Main { public void Main(); public static void main(String[]); }
project_4/build/classes/project4/RecLinkedList.class
package project4; public synchronized class RecLinkedList implements Iterable { private java.util.LinkedList list; public void RecLinkedList(); public void add(Object); public int indexOf(Object); public Object get(int); public Object get(int, int); public void remove(Object); private int remove(Object, int); public int size(); public void replace(Object, Object); private int locate(int); public java.util.ListIterator iterator(); public String toString(); }
project_4/build.xml
Builds, tests, and runs the project project_4.
project_4/dist/README.TXT
======================== BUILD OUTPUT DESCRIPTION ======================== When you build an Java application project that has a main class, the IDE automatically copies all of the JAR files on the projects classpath to your projects dist/lib folder. The IDE also adds each of the JAR files to the Class-Path element in the application JAR files manifest file (MANIFEST.MF). To run the project from the command line, go to the dist folder and type the following: java -jar "project_4.jar" To distribute this project, zip up the dist folder (including the lib folder) and distribute the ZIP file. Notes: * If two JAR files on the project classpath have the same name, only the first JAR file is copied to the lib folder. * Only JAR files are copied to the lib folder. If the classpath contains other types of files or folders, these files (folders) are not copied. * If a library on the projects classpath also has a Class-Path element specified in the manifest,the content of the Class-Path element has to be on the projects runtime path. * To set a main class in a standard Java project, right-click the project node in the Projects window and choose Properties. Then click Run and enter the class name in the Main Class field. Alternatively, you can manually type the class name in the manifest Main-Class element.
project_4/manifest.mf
Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build
project_4/nbproject/build-impl.xml
Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar Must set javac.includes Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent Must select some files in the IDE or set javac.includes To run this application from the command line without Ant, try: java -cp "${run.classpath.with.dist.jar}" ${main.class} To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes Must select one file in the IDE or set profile.class Must select some files in the IDE or set javac.includes Some tests failed; see details above. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url
project_4/nbproject/genfiles.properties
build.xml.data.CRC32=09a3aba6 build.xml.script.CRC32=6768a60a [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=09a3aba6 nbproject/build-impl.xml.script.CRC32=dfb323ef nbproject/[email protected]
project_4/nbproject/private/config.properties
project_4/nbproject/private/private.properties
compile.on.save=true do.depend=false do.jar=true javac.debug=true javadoc.preview=true user.properties.file=C:\\Users\\JAHGUY\\.netbeans\\7.1.2\\build.properties
project_4/nbproject/project.properties
annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output application.title=project_4 application.vendor=JAHGUY build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath=\ ${run.classpath} debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/project_4.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.processorpath=\ ${javac.classpath} javac.source=1.6 javac.target=1.6 javac.test.classpath=\ ${javac.classpath}:\ ${build.classes.dir} javac.test.processorpath=\ ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=project4.Main manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} # Space-separated list of JVM arguments used when running the project # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value # or test-sys-prop.name=value to set system properties for unit tests): run.jvmargs= run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test
project_4/nbproject/project.xml
org.netbeans.modules.java.j2seproject project_4
project_4/project_4.jar
META-INF/MANIFEST.MF
Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.3 Created-By: 1.6.0_25-b06 (Sun Microsystems Inc.) Class-Path: X-COMMENT: Main-Class will be added automatically by build Main-Class: project4.Main
project4/HelpLists.class
package project4; public synchronized class HelpLists { public void HelpLists(); public void reverse(RecLinkedList); public void FIFO(RecLinkedList); }
project4/Main.class
package project4; public synchronized class Main { public void Main(); public static void main(String[]); }
project4/RecLinkedList.class
package project4; public synchronized class RecLinkedList implements Iterable { private java.util.LinkedList list; public void RecLinkedList(); public void add(Object); public int indexOf(Object); public Object get(int); public Object get(int, int); public void remove(Object); private int remove(Object, int); public int size(); public void replace(Object, Object); private int locate(int); public java.util.ListIterator iterator(); public String toString(); }
project_4/src/project4/HelpLists.java
project_4/src/project4/HelpLists.java
package
project4
;
import
java
.
util
.
PriorityQueue
;
import
java
.
util
.
Stack
;
public
class
HelpLists
{
public
void
reverse
(
RecLinkedList
<
String
>
strings
){
Stack
<
String
>
stack
=
new
Stack
<
String
>
();
for
(
int
i
=
0
;
i
<
strings
.
size
();
i
++
){
stack
.
add
(
strings
.
get
(
i
));
}
int
size
=
stack
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++
){
System
.
out
.
println
(
stack
.
pop
());
}
}
public
void
FIFO
(
RecLinkedList
<
String
>
strings
){
PriorityQueue
<
String
>
stack
=
new
PriorityQueue
<
String
>
();
for
(
int
i
=
0
;
i
<
strings
.
size
();
i
++
){
stack
.
add
(
strings
.
get
(
i
));
}
int
size
=
stack
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++
){
System
.
out
.
println
(
stack
.
remove
());
}
}
}
project_4/src/project4/Main.java
project_4/src/project4/Main.java
package
project4
;
import
java
.
io
.
File
;
import
java
.
io
.
FileNotFoundException
;
import
java
.
util
.
ListIterator
;
import
java
.
util
.
Scanner
;
public
class
Main
{
/**
*
@param
args
*/
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"\t\t#############################################"
);
System
.
out
.
println
(
"\t\t### This program was written by Dr. Farag ###"
);
System
.
out
.
println
(
"\t\t#############################################"
);
RecLinkedList
<
String
>
list
=
new
RecLinkedList
<
String
>
();
File
inputFile
=
new
File
(
"StudentData.txt"
);
try
{
Scanner
input
=
new
Scanner
(
inputFile
);
while
(
input
.
hasNextLine
()){
list
.
add
(
input
.
nextLine
());
}
System
.
out
.
println
(
"\tDisplaying List content using traditional for loop"
);
for
(
int
i
=
list
.
size
()
-
1
;
i
>=
0
;
i
--
){
System
.
out
.
println
(
"Name of student # "
+
i
+
" is "
+
list
.
get
(
i
));
}
System
.
out
.
println
(
"The last element in the list is: "
+
list
.
get
(
list
.
size
()
-
1
));
System
.
out
.
println
(
"The first element in the list is: "
+
list
.
get
(
0
));
list
.
remove
(
list
.
get
(
list
.
size
()
-
1
));
System
.
out
.
println
(
"The size of the list after the removal of last element: "
+
list
.
size
());
System
.
out
.
println
(
"\tDisplaying List content using enhanced for loop"
);
for
(
String
student
:
list
){
System
.
out
.
println
(
student
);
}
ListIterator
<
String
>
iter
=
(
ListIterator
<
String
>
)
list
.
iterator
();
iter
.
next
();
iter
.
next
();
iter
.
next
();
iter
.
next
();
System
.
out
.
println
(
"The current student after advancing the iter five positions is: "
+
iter
.
next
());
iter
.
add
(
"Kelly"
);
System
.
out
.
println
(
list
.
toString
());
iter
.
previous
();
iter
.
set
(
"Nancy"
);
System
.
out
.
println
(
"\tDisplaying List after setting the current element to George"
);
System
.
out
.
println
(
list
.
toString
());
iter
.
previous
();
iter
.
remove
();
System
.
out
.
println
(
"\tDisplaying List after previous then remove"
);
System
.
out
.
println
(
list
.
toString
());
HelpLists
help
=
new
HelpLists
();
System
.
out
.
println
(
"\tDisplaying List in reverse() method"
);
help
.
reverse
(
list
);
System
.
out
.
println
();
System
.
out
.
println
(
"\tDisplaying List in FIFO method"
);
help
.
FIFO
(
list
);
System
.
out
.
println
();
}
catch
(
FileNotFoundException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
}
project_4/src/project4/RecLinkedList.java
project_4/src/project4/RecLinkedList.java
package
project4
;
import
java
.
util
.
LinkedList
;
import
java
.
util
.
ListIterator
;
public
class
RecLinkedList
<
T
>
implements
Iterable
<
T
>
{
private
LinkedList
<
T
>
list
;
public
RecLinkedList
(){
list
=
new
LinkedList
<
T
>
();
}
public
void
add
(
T name
){
if
(
list
.
size
()
==
0
)
list
.
add
(
0
,
name
);
else
{
int
index
=
locate
(
0
);
list
.
add
(
index
+
1
,
name
);
}
}
public
int
indexOf
(
T name
){
return
remove
(
name
,
0
);
}
public
T get
(
int
i
){
return
get
(
0
,
i
);
}
public
T get
(
int
i
,
int
index
){
if
(
i
==
index
)
return
list
.
get
(
index
);
return
get
(
++
i
,
index
);
}
public
void
remove
(
T name
){
int
index
=
remove
(
name
,
0
);
if
(
index
>-
1
)
list
.
remove
(
index
);
}
private
int
remove
(
T name
,
int
index
){
if
(
list
.
get
(
index
).
equals
(
name
)){
return
index
;
}
return
remove
(
name
,
++
index
);
}
public
int
size
(){
return
locate
(
0
)
+
1
;
}
public
void
replace
(
T name
,
T newName
){
int
index
=
remove
(
name
,
0
);
if
(
index
>-
1
){
list
.
remove
(
index
);
list
.
add
(
index
,
newName
);
}
}
private
int
locate
(
int
index
){
if
(
list
.
get
(
index
).
equals
(
list
.
get
(
list
.
size
()
-
1
))){
return
index
;
}
else
return
locate
(
++
index
);
}
public
ListIterator
<
T
>
iterator
()
{
ListIterator
<
T
>
listIterator
=
list
.
listIterator
();
return
listIterator
;
}
public
String
toString
(){
return
list
.
toString
();
}
}
project_4/StudentData.txt
AbdulAllah Bonnie Daniel Gary Jared Lydia Matt Mike Robert Sean