generated from GreenRiverCollege-SDEV333/IntListReview
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3983314
Showing
8 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
### IntelliJ IDEA ### | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** | ||
* The IntList interface defines a set of operations | ||
* for an ordered (indexed) collection of ints, which | ||
* in mathematics is known as a sequence. | ||
*/ | ||
public interface IntList extends Iterable<Integer> { | ||
|
||
/** | ||
* Prepends (inserts) the specified value at the front of the list (at index 0). | ||
* Shifts the value currently at the front of the list (if any) and any | ||
* subsequent values to the right. | ||
* @param value value to be inserted | ||
*/ | ||
void addFront(int value); | ||
|
||
/** | ||
* Appends (inserts) the specified value at the back of the list (at index size()-1). | ||
* @param value value to be inserted | ||
*/ | ||
void addBack(int value); | ||
|
||
/** | ||
* Inserts the specified value at the specified position in this list. | ||
* Shifts the value currently at that position (if any) and any subsequent | ||
* values to the right. | ||
* @param index index at which the specified value is to be inserted | ||
* @param value value to be inserted | ||
* @throws IndexOutOfBoundsException if the index is out of range | ||
*/ | ||
void add(int index, int value); | ||
|
||
/** | ||
* Removes the value located at the front of the list | ||
* (at index 0), if it is present. | ||
* Shifts any subsequent values to the left. | ||
*/ | ||
void removeFront(); | ||
|
||
/** | ||
* Removes the value located at the back of the list | ||
* (at index size()-1), if it is present. | ||
*/ | ||
void removeBack(); | ||
|
||
/** | ||
* Removes the value at the specified position in this list. | ||
* Shifts any subsequent values to the left. Returns the value | ||
* that was removed from the list. | ||
* @param index the index of the value to be removed | ||
* @return the value previously at the specified position | ||
* @throws IndexOutOfBoundsException if the index is out of range | ||
*/ | ||
int remove(int index); | ||
|
||
/** | ||
* Returns the value at the specified position in the list. | ||
* @param index index of the value to return | ||
* @return the value at the specified position in this list | ||
* @throws IndexOutOfBoundsException if the index is out of range | ||
*/ | ||
int get(int index); | ||
|
||
/** | ||
* Returns true if this list contains the specified value. | ||
* @param value value whose presence in this list is to be searched for | ||
* @return true if this list contains the specified value | ||
*/ | ||
boolean contains(int value); | ||
|
||
/** | ||
* Returns the index of the first occurrence of the specified value | ||
* in this list, or -1 if this list does not contain the value. | ||
* @param value value to search for | ||
* @return the index of the first occurrence of the specified value in this list | ||
* or -1 if this list does not contain the value | ||
*/ | ||
int indexOf(int value); | ||
|
||
/** | ||
* Returns true if this list contains no values. | ||
* @return true if this list contains no values | ||
*/ | ||
boolean isEmpty(); | ||
|
||
/** | ||
* Returns the number of values in this list. | ||
* @return the number of values in this list | ||
*/ | ||
int size(); | ||
|
||
/** | ||
* Removes all the values from this list. | ||
* The list will be empty after this call returns. | ||
*/ | ||
void clear(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or | ||
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter. | ||
public class Main { | ||
public static void main(String[] args) { | ||
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text | ||
// to see how IntelliJ IDEA suggests fixing it. | ||
System.out.printf("Hello and welcome!"); | ||
|
||
for (int i = 1; i <= 5; i++) { | ||
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint | ||
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>. | ||
System.out.println("i = " + i); | ||
} | ||
} | ||
} |