Assignment08

Assignment08 - { private Map < int, Person...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1. public void reverse(ArrayList<String> aList) { private ArrayList<String> newArray = new ArrayList<String>; for(i = 0; i < aList.size(); i ++) { int z = aList.size() – i; newArray.add(aList.get(z)); } } 2. public void buildIndex(ArrayList<String> aList) { private Map < String, Person > newMap; newMap = new HashMap< String, Person >; for(i = 0; i < aList.size(); i ++) { String newName = aList.get(i); Int newNumber = newName.getNumber(); newMap.put( newName, newNumber); } } 3. public void reverseIndex(Map<String, Person> aMap)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { private Map &lt; int, Person &gt; newMap; newMap = new HashMap&lt; int, Person &gt;; for(i = 0; i &lt; aMap.size(); i ++) { String newName =aMap.get(i); int newNumber = newName.getNumber(); newMap.put( newNumber, newName); } } 4. public void printToN(int i) { for(int n = i; n != 1; i --) { System.out.println(n); } } 5. public void mapToList(Map&lt;String, Person&gt; aMap) { private ArrayList&lt;String&gt; newArray = new ArrayList&lt;String&gt;; for(int i = 0; i &lt; aMap.size(); i ++) { newArray.add(aMap.get(Person)); } }...
View Full Document

This note was uploaded on 03/31/2008 for the course CS 1705 taught by Professor Shedwards during the Spring '08 term at Virginia Tech.

Page1 / 3

Assignment08 - { private Map &amp;amp;lt; int, Person...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online