Microsoft PowerPoint - ch22

Size: px
Start display at page:

Download "Microsoft PowerPoint - ch22"

Transcription

1 Chapter 22 Collections 林偉川 1 Introduction Java collections framework Provides reusable componentry Common data structures Example of code reuse Collection Data structure (object) that can hold references to other objects Collections framework Interfaces declare operations for various collection types Belong to package java.util Collection Map Set List 2 1

2 請注意 Collections 具體類別的相關特性 : 類別實作的介面 類別使用的資料結構 元素可否重複 無序或有序 ( 加入的先後順序, 或有排序功能 ) 是否為執行緒同步 (Thread safe class) 有哪些常見的應用 3 Collections Framework 內的介面架構 <<interface>> Collection <<interface>> Map <<interface>> Set <<interface>> List <<interface>> SortedMap <<interface>> SortedSet 4 2

3 實作 Collections 延伸介面的具體類別 <<interface>> Collection <<interface>> List <<interface>> Set Vector ArrayList LinkedList HashSet <<interface>> SortedSet Stack LinkedHashSet TreeSet 5 Collection 介面 Collection 介面定義的集合, 其元素可以為無順序 (non-ordered) 和可重複 (repetition allowed) Collection 兩個延伸介面 List 和 Set, 分別保有 Collection 的不同特性 Set 的特點為, 其元素不可重複 SortedSet 介面繼承 Set 介面, 且宣告了排序的方法 List 介面繼承 Collection 介面, 然而它是有順序的, 而且是可以重複的 6 3

4 Map 介面 Map 介面和 Collection 介面沒有繼承的關係 Map 介面的元素是 鍵值對 (key-value pairs) Map 中的 key 和 value 皆為參照變數, 而且 key 不能重複, 一個 key 對應到一個 value Map 中的元素是沒有順序的 SortedMap 介面為 Map 的子介面, 故名思義, 其為可排序的集合 7 Collection 中所使用的基本資料結構 陣列 (array) 鏈結串列 (linked list) 樹 (tree) 雜湊表 (hash table) 8 4

5 陣列的重要特性 : 存取元素的速度快 要在某位置插入或移除元素值時, 並不方便 陣列長度為固定, 欲改變長度必須重新建立另一個陣列 9 Class Arrays Class Arrays Provides static methods for manipulating arrays Provides high-level methods Method binarysearch for searching sorted arrays Method equals for comparing arrays Method fill for placing values into arrays Method sort for sorting arrays 10 5

6 Arrays Arrays 的靜態方法 List aslist(object[] a) int binarysearch(int[] a, int key) boolean equals(int[] a, int[] 比較兩陣列 a 和 a2, 若兩陣列中的元素值皆相等 a2) 則回傳 true 此方法有許多因應不同型別陣列的多載方法 void fill(int[] a, int val) void sort(int[] a) 說明 將 Object 陣列 a 轉換成 List 物件, 然後回傳 在已排序的 a 陣列中以二次搜尋法, 找出 key 的索引值 若找不到 key 則回傳 1 此方法有許多因應不同型別陣列的多載方法 將 a 陣列中的所有的元素值設定為 val 此方法有許多因應不同型別陣列的多載方法 對陣列 a 排序 此方法有許多因應不同參數的多載方法 11 鏈結串列 可以鏈結的類別 class LinkedObj{ Object data; LinkedObj next; } // 節點資料 // 下一個節點 鏈結串列的重要特性 : 插入或刪除節點很方便 變更鏈結串列的長度也很方便 存取節點的速度較慢 12 6

7 Collections Collections 中的靜態方法大都針對 List, 因為 List 不像 Set 和 Map 有可排序的類別 Collections 另外提供將 非執行緒同步 集合包裹成 執行緒同步 集合的方法, 這些方法在多執行緒程式裡會顯得相當方便 13 Collections 的常用靜態方法 int binarysearch(list list, Object key) void copy(list dest, List src) boolean replaceall(list list, Object oldval, Object newval) void reverse(list list) void shuffle(list list) void sort(list list) List synchronizedlist(list list) Map synchronizedmap(map m) Set synchronizedset(set s) SortedMap synchronizedsortedmap(sortedmap m) 說明 以二次搜尋法, 找出 key 的索引值 將 src 序列的所元素複製給 dest 序列 將 list 序列中的 oldval 換成 newval 物件 若 oldval 不包含在 list 內則回傳 false 將 list 序列的順序顛倒 亂數重排 list 序列中元素的順序 對 list 序列排序 取得一執行緒同步的集合 SortedSet synchronizedsortedset(sortedset s) 14 7

8 樹 實體可以做為二元樹的節點的類別 class TreeNode{ Object data; TreeNode left; TreeNode right; } 樹的優點是有 排序 的功能, 缺點和鏈結串列一樣, 節點資料的存取都比較慢 15 雜湊表雜湊表 (hash table) 的資料是以 鍵值對 (key value paired) 的形式存在 加入一個元素時必須同時給予一個 key 和一個 value, 透過 key 就可以取得 value 雜湊表的特點 : 存取資料的速度快 較浪費記憶體空間 16 8

9 是否相等 Object.equals() 的定義如下 : public boolean equals(object obj){ return (this == obj); } 當兩個物件 obj1 和 obj2 使用 equals() 比較後認定為相等時, 他們由 hashcode() 方法所取得的雜湊碼也必須相同 所以當兩物件相等時, 以下兩個運算式的結果都必須為 true obj1.equals(obj2)== obj2.equals(obj1)== true obj1.hashcode()== obj2.hashcode() 17 是否相等 hashcode() 方法在使用 hash table 的集合中顯得相當重要, 因為 hash table 是以 key.hashcode() 取得的 hash code value 當你覆蓋 equals() 方法時, 也必須覆蓋 hashcode() 方法, 讓兩者的行為一致 18 9

10 是否相等 Integer 類別中定義的 equals() public boolean equals(object obj){ if(obj instanceof Integer){ return value == ((Integer)obj).intValue(); } return false; } Integer 類別中定義的 hashcode() public int hashcode(){ return value; } 19 String 類別的 equals() 方法 public boolean equals(object anobject){ if (this == anobject){ return true; // 參照相同 } if (anobject instanceof String){ String anotherstring = (String)anObject; int n = count; // 字串長度 if (n == anotherstring.count){ char v1[] = value; // 字元陣列 char v2[] = anotherstring.value; int i = offset; // 第一字元的位置 int j = anotherstring.offset; while (n--!= 0){ if (v1[i++]!= v2[j++]) return false; // 有任何字元不同 } return true; // 所有字元都相同 } } return false; // 不是 String 型別 } 20 10

11 是否相等 String 類別的 hashcode() 方法 public int hashcode(){ int h = hash; if(h == 0){ int off = offset; char val[] = value; int len = count; } for (int i = 0; i < len; i++){ // 計算雜湊碼的規則 h = 31*h + val[off++]; } hash = h; } return h; // 取得字串的雜湊碼 // 若雜湊碼為 0 表示倘未計算 // 第一個字元的位置 // 取得字元陣列 // 字串的長度 s[0]*31^(n-1)+ s[1]*31^(n-2) s[n-1] 21 是否相等自訂類別的 equals() 和 hashcode() 定義 equals() 時, 可以一一比對各個屬性是否相等 屬性大多為現成的類別或基本資料型別, 因此, 就可以使用現成的類別的 equals() 方法 定義 hashcode() 時, 只要將屬性的雜湊碼相互做位元互斥 (XOR,^) 運算即可 22 11

12 較大或較小 TreeSet 和 TreeMap 都有自動排序的功能, 既然要能排序必定有比較大小的規則 使用 tree 實作的 collection, 其元素必須是相同型別的物件, 而且必須實作 Comparable 介面 String 類別和基本型別的包裝器 (Boolean 除外 ) 實作了 Comparable 介面 23 較大或較小 Comparable 介面只宣告一個抽象方法 compareto() int compareto(object o); 實作 compareto() 方法必須遵守不同型別的物件不能比較若物件本身比傳入的物件小時, 則回傳負值 若物件本身比傳入的物件大時, 則回傳正值 若不大也不小時, 回傳

13 1 // Fig. 22.1: UsingArrays.java 2 // Using Java arrays. 3 import java.util.*; 4 5 public class UsingArrays { 6 private int intvalues[] = { 1, 2, 3, 4, 5, 6 }; 7 private double doublevalues[] = { 8.4, 9.3, 0.2, 7.9, 3.4 }; 8 private int filledint[], intvaluescopy[]; 9 10 // initialize arrays 11 public UsingArrays() 12 { 13 filledint = new int[ 10 ]; 14 intvaluescopy = new int[ intvalues.length ]; Arrays.fill( filledint, 7 ); // fill with 7s Arrays.sort( doublevalues ); // sort doublevalues ascending // copy array intvalues into array intvaluescopy 21 System.arraycopy( intvalues, 0, intvaluescopy, 22 0, intvalues.length ); 23 } 24 UsingArrays.java Line 16 Line 18 Lines // output values in each array 26 public void printarrays() 27 { 28 System.out.print( "doublevalues: " ); for ( int count = 0; count < doublevalues.length; count++ ) 31 System.out.print( doublevalues[ count ] + " " ); System.out.print( "\nintvalues: " ); for ( int count = 0; count < intvalues.length; count++ ) 36 System.out.print( intvalues[ count ] + " " ); System.out.print( "\nfilledint: " ); for ( int count = 0; count < filledint.length; count++ ) 41 System.out.print( filledint[ count ] + " " ); System.out.print( "\nintvaluescopy: " ); for ( int count = 0; count < intvaluescopy.length; count++ ) 46 System.out.print( intvaluescopy[ count ] + " " ); System.out.println(); } // end method printarrays 51 UsingArrays.java 13

14 52 // find value in array intvalues 53 public int searchforint( int value ) 54 { 55 return Arrays.binarySearch( intvalues, value ); 56 } // compare array contents 59 public void printequality() 60 { 61 boolean b = Arrays.equals( intvalues, intvaluescopy ); System.out.println( "intvalues " + ( b? "==" : "!=" ) + 64 " intvaluescopy" ); b = Arrays.equals( intvalues, filledint ); System.out.println( "intvalues " + ( b? "==" : "!=" ) + 69 " filledint" ); 70 } 71 UsingArrays.java Line 55 Lines 61 and public static void main( String args[] ) 73 { 74 UsingArrays usingarrays = new UsingArrays(); usingarrays.printarrays(); 77 usingarrays.printequality(); int location = usingarrays.searchforint( 5 ); 80 System.out.println( ( location >= 0? "Found 5 at element " + 81 location : "5 not found" ) + " in intvalues" ); location = usingarrays.searchforint( 8763 ); 84 System.out.println( ( location >= 0? "Found 8763 at element " + 85 location : "8763 not found" ) + " in intvalues" ); 86 } } // end class UsingArrays UsingArrays.java doublevalues: intvalues: filledint: intvaluescopy: intvalues == intvaluescopy intvalues!= filledint Found 5 at element 4 in intvalues 8763 not found in intvalues 14

15 1 // Fig. 22.2: UsingAsList.java 2 // Using method aslist. 3 import java.util.*; 4 5 public class UsingAsList { 6 private static final String values[] = { "red", "white", "blue" }; 7 private List list; 8 9 // initialize List and set value at location 1 10 public UsingAsList() 11 { 12 list = Arrays.asList( values ); // get List 13 list.set( 1, "green" ); // change a value 14 } // output List and array 17 public void printelements() 18 { 19 System.out.print( "List elements : " ); for ( int count = 0; count < list.size(); count++ ) 22 System.out.print( list.get( count ) + " " ); System.out.print( "\narray elements: " ); 25 UsingAsList.java Line 12 Line 13 Line 21 Line for ( int count = 0; count < values.length; count++ ) 27 System.out.print( values[ count ] + " " ); System.out.println(); 30 } public static void main( String args[] ) 33 { 34 new UsingAsList().printElements(); 35 } } // end class UsingAsList UsingAsList.java List elements : red green blue Array elements: red green blue 15

16 Interface Collection and Class Collections Interface Collection Contains bulk operations Adding, clearing, comparing and retaining objects Interfaces Set and List extend interface Collection Class Collections Provides static methods that manipulate collections Collections can be manipulated polymorphically 31 Lists List Ordered Collection that can contain duplicate elements Sometimes called a sequence Implemented via interface List ArrayList LinkedList Vector 32 16

17 1 // Fig. 22.3: CollectionTest.java 2 // Using the Collection interface. 3 import java.awt.color; 4 import java.util.*; 5 6 public class CollectionTest { 7 private static final String colors[] = { "red", "white", "blue" }; 8 9 // create ArrayList, add objects to it and manipulate it 10 public CollectionTest() 11 { 12 List list = new ArrayList(); // add objects to list 15 list.add( Color.MAGENTA ); // add a color object for ( int count = 0; count < colors.length; count++ ) 18 list.add( colors[ count ] ); list.add( Color.CYAN ); // add a color object // output list contents 23 System.out.println( "\narraylist: " ); for ( int count = 0; count < list.size(); count++ ) 26 System.out.print( list.get( count ) + " " ); 27 CollectionTest.java Lines Line // remove all String objects 29 removestrings( list ); // output list contents 32 System.out.println( "\n\narraylist after calling removestrings: " ); for ( int count = 0; count < list.size(); count++ ) 35 System.out.print( list.get( count ) + " " ); } // end constructor CollectionTest // remove String objects from Collection 40 private void removestrings( Collection collection ) 41 { 42 Iterator iterator = collection.iterator(); // get iterator // loop while collection has items 45 while ( iterator.hasnext() ) if ( iterator.next() instanceof String ) 48 iterator.remove(); // remove String object 49 } 50 CollectionTest.java Line 29 Line 42 Line 45 Line 47 Line 48 17

18 51 public static void main( String args[] ) 52 { 53 new CollectionTest(); 54 } } // end class CollectionTest CollectionTest.java ArrayList: java.awt.color[r=255,g=0,b=255] red white blue java.awt.color [r=0,g=255,b=255] ArrayList after calling removestrings: java.awt.color[r=255,g=0,b=255] java.awt.color[r=0,g=255,b=255] 1 // Fig. 22.4: ListTest.java 2 // Using LinkLists. 3 import java.util.*; 4 5 public class ListTest { 6 private static final String colors[] = { "black", "yellow", 7 "green", "blue", "violet", "silver" }; 8 private static final String colors2[] = { "gold", "white", 9 "brown", "blue", "gray", "silver" }; // set up and manipulate LinkedList objects 12 public ListTest() 13 { 14 List link = new LinkedList(); 15 List link2 = new LinkedList(); // add elements to each list 18 for ( int count = 0; count < colors.length; count++ ) { 19 link.add( colors[ count ] ); 20 link2.add( colors2[ count ] ); 21 } link.addall( link2 ); // concatenate lists 24 link2 = null; // release resources 25 ListTest.java Lines Line 23 Line 24 18

19 26 printlist( link ); uppercasestrings( link ); printlist( link ); System.out.print( "\ndeleting elements 4 to 6..." ); 33 removeitems( link, 4, 7 ); printlist( link ); printreversedlist( link ); } // end constructor ListTest // output List contents 42 public void printlist( List list ) 43 { 44 System.out.println( "\nlist: " ); for ( int count = 0; count < list.size(); count++ ) 47 System.out.print( list.get( count ) + " " ); System.out.println(); 50 } ListTest.java Lines // locate String objects and convert to uppercase 53 private void uppercasestrings( List list ) 54 { 55 ListIterator iterator = list.listiterator(); while ( iterator.hasnext() ) { 58 Object object = iterator.next(); // get item if ( object instanceof String ) // check for String 61 iterator.set( ( ( String ) object ).touppercase() ); 62 } 63 } // obtain sublist and use clear method to delete sublist items 66 private void removeitems( List list, int start, int end ) 67 { 68 list.sublist( start, end ).clear(); // remove items 69 } // print reversed list 72 private void printreversedlist( List list ) 73 { 74 ListIterator iterator = list.listiterator( list.size() ); 75 ListTest.java Lines Line 68 19

20 76 System.out.println( "\nreversed List:" ); // print list in reverse order 79 while( iterator.hasprevious() ) 80 System.out.print( iterator.previous() + " " ); 81 } public static void main( String args[] ) 84 { 85 new ListTest(); 86 } } // end class ListTest ListTest.java Line 79 Line 80 list: black yellow green blue violet silver gold white brown blue gray silver list: BLACK YELLOW GREEN BLUE VIOLET SILVER GOLD WHITE BROWN BLUE GRAY SILVER Deleting elements 4 to 6... list: BLACK YELLOW GREEN BLUE WHITE BROWN BLUE GRAY SILVER Reversed List: SILVER GRAY BLUE BROWN WHITE BLUE GREEN YELLOW BLACK 1 // Fig. 22.5: UsingToArray.java 2 // Using method toarray. 3 import java.util.*; 4 5 public class UsingToArray { 6 7 // create LinkedList, add elements and convert to array 8 public UsingToArray() 9 { 10 String colors[] = { "black", "blue", "yellow" }; LinkedList links = new LinkedList( Arrays.asList( colors ) ); links.addlast( "red" ); // add as last item 15 links.add( "pink" ); // add to the end 16 links.add( 3, "green" ); // add at 3rd index 17 links.addfirst( "cyan" ); // add as first item // get LinkedList elements as an array 20 colors = ( String [] ) links.toarray( new String[ links.size() ] ); System.out.println( "colors: " ); 23 UsingToArray.java Line 20 20

21 24 for ( int count = 0; count < colors.length; count++ ) 25 System.out.println( colors[ count ] ); 26 } public static void main( String args[] ) 29 { 30 new UsingToArray(); 31 } } // end class UsingToArray UsingToArray.java colors: cyan black blue yellow green red pink 請注意 Collection 具體類別的相關特性 : 類別實作的介面 類別使用的資料結構 元素可否重複 無序或有序 ( 加入的先後順序, 或有排序功能 ) 是否為執行緒同步 (Thread safe class) 有哪些常見的應用 42 21

22 實作 Collection 延伸介面的具體類別 <<interface>> Collection <<interface>> List <<interface>> Set Vector ArrayList LinkedList HashSet <<interface>> SortedSet Stack LinkedHashSet TreeSet 43 實作 List 介面的具體類別 ArrayList 使用 array 資料結構實作 List 保有陣列的特性, 存取元素的效率佳, 但不利於插入或移除元素, 且重定陣列長度效率差 LinkedList 使用 linked list 實作 List 保有 linked list 的特性, 存取元素的效率較差, 但利於插入元素 移除元素和改變長度 Vector 和 ArrayList 很像, 都是以 array 實作 List 兩者最大的不同是在於 :Vector 為 執行緒同步類別, 而 ArrayList 則否 44 22

23 實作 List 介面的具體類別 Stack 為 Vector 的延伸類別, 所以同樣為有序 執行緒同步類別 Stack 類別是堆疊的抽象資料型別 (Abstract Data Type) 推入 A 推入 B 推入 C 彈出 C C B B B A A A A 45 Algorithms Collections Framework provides set of algorithms Implemented as static methods List algorithms sort binarysearch reverse shuffle fill copy Collection algorithms min max 46 23

24 Algorithm sort sort Sorts List elements Order is determined by natural order of elements type Relatively fast 47 3 import java.util.*; 4 5 public class Sort1 { 6 private static final String suits[] = 7 { "Hearts", "Diamonds", "Clubs", "Spades" }; 8 9 // display array elements 10 public void printelements() 11 { 12 // create ArrayList 13 List list = new ArrayList( Arrays.asList( suits ) ); // output list 16 System.out.println( "Unsorted array elements:\n" + list ); Collections.sort( list ); // sort ArrayList // output list 21 System.out.println( "Sorted array elements:\n" + list ); 22 } public static void main( String args[] ) 25 { 26 new Sort1().printElements(); 27 } 28 } // end class Sort1 Unsorted array elements: [Hearts, Diamonds, Clubs, Spades] Sorted array elements: [Clubs, Diamonds, Hearts, Spades] Sort1.java Line 13 Line 18 24

25 1 // Fig. 22.7: Sort2.java 2 // Using a Comparator object with algorithm sort. 3 import java.util.*; 4 5 public class Sort2 { 6 private static final String suits[] = 7 { "Hearts", "Diamonds", "Clubs", "Spades" }; 8 9 // output List elements 10 public void printelements() 11 { 12 List list = Arrays.asList( suits ); // create List // output List elements 15 System.out.println( "Unsorted array elements:\n" + list ); // sort in descending order using a comparator 18 Collections.sort( list, Collections.reverseOrder() ); // output List elements 21 System.out.println( "Sorted list elements:\n" + list ); 22 } 23 public static void main( String args[] ) { new Sort2().printElements(); } 24 } // end class Sort2 Unsorted array elements: [Hearts, Diamonds, Clubs, Spades] Sorted list elements: [Spades, Hearts, Diamonds, Clubs] Sort2.java Line 18 Line 18 1 // Fig. 22.8: Sort3.java 2 // Creating a custom Comparator class. 3 import java.util.*; 4 5 public class Sort3 { 6 7 public void printelements() 8 { 9 List list = new ArrayList(); // create List list.add( new Time2( 6, 24, 34 ) ); 12 list.add( new Time2( 18, 14, 05 ) ); 13 list.add( new Time2( 8, 05, 00 ) ); 14 list.add( new Time2( 12, 07, 58 ) ); 15 list.add( new Time2( 6, 14, 22 ) ); // output List elements 18 System.out.println( "Unsorted array elements:\n" + list ); // sort in order using a comparator 21 Collections.sort( list, new TimeComparator() ); // output List elements 24 System.out.println( "Sorted list elements:\n" + list ); 25 } 26 Sort3.java Line 21 25

26 27 public static void main( String args[] ) 28 { 29 new Sort2().printElements(); 30 } private class TimeComparator implements Comparator { 33 int hourcompare, minutecompare, secondcompare; 34 Time2 time1, time2; public int compare(object object1, Object object2) 37 { 38 // cast the objects 39 time1 = (Time2)object1; 40 time2 = (Time2)object2; hourcompare = new Integer( time1.gethour() ).compareto( 43 new Integer( time2.gethour() ) ); // test the hour first 46 if ( hourcompare!= 0 ) 47 return hourcompare; minutecompare = new Integer( time1.getminute() ).compareto( 50 new Integer( time2.getminute() ) ); 51 Sort3.java Line 32 Line // then test the minute 53 if ( minutecompare!= 0 ) 54 return minutecompare; secondcompare = new Integer( time1.getsecond() ).compareto( 57 new Integer( time2.getsecond() ) ); return secondcompare; // return result of comparing seconds 60 } } // end class TimeComparator } // end class Sort3 Sort3.java Unsorted array elements: [06:24:34, 18:14:05, 08:05:00, 12:07:58, 06:14:22] Sorted list elements: [06:14:22, 06:24:34, 08:05:00, 12:07:58, 18:14:05] 26

27 shuffle Algorithm shuffle Randomly orders List elements 53 1 // Fig. 22.9: Cards.java 2 // Using algorithm shuffle. 3 import java.util.*; 4 5 // class to represent a Card in a deck of cards 6 class Card { 7 private String face; 8 private String suit; 9 10 // initialize a Card 11 public Card( String initialface, String initialsuit ) 12 { 13 face = initialface; 14 suit = initialsuit; 15 } // return face of Card 18 public String getface() 19 { 20 return face; 21 } // return suit of Card 24 public String getsuit() 25 { 26 return suit; 27 } Cards.java 27

28 28 29 // return String representation of Card 30 public String tostring() 31 { 32 StringBuffer buffer = new StringBuffer( face + " of " + suit ); 33 buffer.setlength( 20 ); return buffer.tostring(); 36 } } // end class Card // class Cards declaration 41 public class Cards { 42 private static final String suits[] = 43 { "Hearts", "Clubs", "Diamonds", "Spades" }; 44 private static final String faces[] = { "Ace", "Deuce", "Three", 45 "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", 46 "Jack", "Queen", "King" }; 47 private List list; // set up deck of Cards and shuffle 50 public Cards() 51 { 52 Card deck[] = new Card[ 52 ]; 53 Cards.java 54 for ( int count = 0; count < deck.length; count++ ) 55 deck[ count ] = new Card( faces[ count % 13 ], 56 suits[ count / 13 ] ); list = Arrays.asList( deck ); // get List 59 Collections.shuffle( list ); // shuffle deck 60 } // output deck 63 public void printcards() 64 { 65 int half = list.size() / 2-1; for ( int i = 0, j = half + 1; i <= half; i++, j++ ) 68 System.out.println( list.get( i ).tostring() + list.get( j ) ); 69 } public static void main( String args[] ) 72 { 73 new Cards().printCards(); 74 } } // end class Cards Cards.java Line 59 28

29 King of Diamonds Jack of Spades Four of Diamonds Six of Clubs King of Hearts Nine of Diamonds Three of Spades Four of Spades Four of Hearts Seven of Spades Five of Diamonds Eight of Hearts Queen of Diamonds Five of Hearts Seven of Diamonds Seven of Hearts Nine of Hearts Three of Clubs Ten of Spades Deuce of Hearts Three of Hearts Ace of Spades Six of Hearts Eight of Diamonds Six of Diamonds Deuce of Clubs Ace of Clubs Ten of Diamonds Eight of Clubs Queen of Hearts Jack of Clubs Ten of Clubs Seven of Clubs Queen of Spades Five of Clubs Six of Spades Nine of Spades Nine of Clubs King of Spades Ace of Diamonds Ten of Hearts Ace of Hearts Queen of Clubs Deuce of Spades Three of Diamonds King of Clubs Four of Clubs Jack of Diamonds Eight of Spades Five of Spades Jack of Hearts Deuce of Diamonds Cards.java Algorithms reverse, fill, copy, max and min reverse fill Reverses the order of List elements Populates List elements with values copy Creates copy of a List max min Returns largest element in List Returns smallest element in List 58 29

30 1 // Fig : Algorithms1.java 2 // Using algorithms reverse, fill, copy, min and max. 3 import java.util.*; 4 5 public class Algorithms1 { 6 private String letters[] = { "P", "C", "M" }, letterscopy[]; 7 private List list, copylist; 8 9 // create a List and manipulate it with methods from Collections 10 public Algorithms1() 11 { 12 list = Arrays.asList( letters ); // get List 13 letterscopy = new String[ 3 ]; 14 copylist = Arrays.asList( letterscopy ); System.out.println( "Initial list: " ); 17 output( list ); Collections.reverse( list ); // reverse order 20 System.out.println( "\nafter calling reverse: " ); 21 output( list ); Collections.copy( copylist, list ); // copy List 24 System.out.println( "\nafter copying: " ); 25 output( copylist ); 26 Algorithms1.java Line 19 Line Collections.fill( list, "R" ); // fill list with Rs 28 System.out.println( "\nafter calling fill: " ); 29 output( list ); } // end constructor // output List information 34 private void output( List listref ) 35 { 36 System.out.print( "The list is: " ); for ( int k = 0; k < listref.size(); k++ ) 39 System.out.print( listref.get( k ) + " " ); System.out.print( "\nmax: " + Collections.max( listref ) ); 42 System.out.println( " Min: " + Collections.min( listref ) ); 43 } public static void main( String args[] ) 46 { 47 new Algorithms1(); 48 } } // end class Algorithms1 Initial list: The list is: P C M Max: P Min: C After calling reverse: The list is: M C P Max: P Min: C After copying: The list is: M C P Max: P Min: C After calling fill: The list is: R R R Max: R Min: R Algorithms1.java Line 27 Line 41 Line 42 30

31 binarysearch Algorithm binarysearch Locates Object in List Returns index of Object in List if Object exists Returns negative value if Object does not exist 61 1 // Fig : BinarySearchTest.java 2 // Using algorithm binarysearch. 3 import java.util.*; 4 5 public class BinarySearchTest { 6 private static final String colors[] = { "red", "white", 7 "blue", "black", "yellow", "purple", "tan", "pink" }; 8 private List list; // List reference 9 10 // create, sort and output list 11 public BinarySearchTest() 12 { 13 list = new ArrayList( Arrays.asList( colors ) ); 14 Collections.sort( list ); // sort the ArrayList 15 System.out.println( "Sorted ArrayList: " + list ); 16 } // search list for various values 19 private void printsearchresults() 20 { 21 printsearchresultshelper( colors[ 3 ] ); // first item 22 printsearchresultshelper( colors[ 0 ] ); // middle item 23 printsearchresultshelper( colors[ 7 ] ); // last item 24 printsearchresultshelper( "aardvark" ); // below lowest 25 printsearchresultshelper( "goat" ); // does not exist 26 printsearchresultshelper( "zebra" ); // does not exist 27 } 28 BinarySearchTest.java Line 14 31

32 29 // helper method to perform searches 30 private void printsearchresultshelper( String key ) 31 { 32 int result = 0; System.out.println( "\nsearching for: " + key ); 35 result = Collections.binarySearch( list, key ); 36 System.out.println( ( result >= 0? "Found at index " + result : 37 "Not Found (" + result + ")" ) ); 38 } public static void main( String args[] ) 41 { 42 new BinarySearchTest().printSearchResults(); 43 } } // end class BinarySearchTest BinarySearchTest.java Line 35 Sorted ArrayList: black blue pink purple red tan white yellow Searching for: black Found at index 0 Searching for: red Found at index 4 Searching for: pink Found at index 2 Searching for: aardvark Not Found (-1) Searching for: goat Not Found (-3) Searching for: zebra Not Found (-9) Set Sets Collection that contains unique elements HashSet Stores elements in hash table TreeSet Stores elements in tree 64 32

33 實作 Collection 延伸介面的具體類別 <<interface>> Collection <<interface>> List <<interface>> Set Vector ArrayList LinkedList HashSet <<interface>> SortedSet Stack LinkedHashSet TreeSet 65 實作 Set 介面的具體類別 HashSet 使用 hash table 實作 Set 元素沒有順序, 而且元素不可重複存在 HashSet 物件內 其 key 和 value 是使用相同的物件, 也就是被加入的物件 LinkedHashSet 除了使用 hash table, 還使用 linked list 實作 Set, 使之成為有序集合 元素的順序是依照加入的順序 TreeSet 使用 tree 實作 SortedSet, 所以元素在加入集合時, 就會和既有的元素 比較, 以排放在適當的位置 66 33

34 1 // Fig : SetTest.java 2 // Using a HashSet to remove duplicates. 3 import java.util.*; 4 5 public class SetTest { 6 private static final String colors[] = { "red", "white", "blue", 7 "green", "gray", "orange", "tan", "white", "cyan", 8 "peach", "gray", "orange" }; 9 10 // create and output ArrayList 11 public SetTest() 12 { 13 List list = new ArrayList( Arrays.asList( colors ) ); 14 System.out.println( "ArrayList: " + list ); 15 printnonduplicates( list ); 16 } // create set from array to eliminate duplicates 19 private void printnonduplicates( Collection collection ) 20 { 21 // create a HashSet and obtain its iterator 22 Set set = new HashSet( collection ); 23 Iterator iterator = set.iterator(); System.out.println( "\nnonduplicates are: " ); 26 SetTest.java Line while ( iterator.hasnext() ) 28 System.out.print( iterator.next() + " " ); System.out.println(); 31 } public static void main( String args[] ) 34 { 35 new SetTest(); 36 } } // end class SetTest SetTest.java Lines ArrayList: [red, white, blue, green, gray, orange, tan, white, cyan, peach, gray, orange] Nonduplicates are: red cyan white tan gray green orange blue peach 34

35 1 // Fig : SortedSetTest.java 2 // Using TreeSet and SortedSet. 3 import java.util.*; 4 5 public class SortedSetTest { 6 private static final String names[] = { "yellow", "green", 7 "black", "tan", "grey", "white", "orange", "red", "green" }; 8 9 // create a sorted set with TreeSet, then manipulate it 10 public SortedSetTest() 11 { 12 SortedSet tree = new TreeSet( Arrays.asList( names ) ); System.out.println( "set: " ); 15 printset( tree ); // get headset based upon "orange" 18 System.out.print( "\nheadset (\"orange\"): " ); 19 printset( tree.headset( "orange" ) ); // get tailset based upon "orange" 22 System.out.print( "tailset (\"orange\"): " ); 23 printset( tree.tailset( "orange" ) ); // get first and last elements 26 System.out.println( "first: " + tree.first() ); 27 System.out.println( "last : " + tree.last() ); 28 } 29 SortedSetTest.java Line 12 Line 19 Line 23 Lines // output set 31 private void printset( SortedSet set ) 32 { 33 Iterator iterator = set.iterator(); while ( iterator.hasnext() ) 36 System.out.print( iterator.next() + " " ); System.out.println(); 39 } public static void main( String args[] ) 42 { 43 new SortedSetTest(); 44 } } // end class SortedSetTest SortedSetTest.java Lines set: black green grey orange red tan white yellow headset ("orange"): black green grey tailset ("orange"): orange red tan white yellow first: black last : yellow 35

36 Map Maps Associates keys to values Cannot contain duplicate keys Called one-to-one mapping 71 實作 Map 介面的具體類別 <<interface>> Map Hashtable HashMap <<interface>> SortedMap Properties LinkedHashMap TreeMap 72 36

37 實作 Map 介面的具體類別 HashMap 使用 hash table 實作 Map, 此集合中 keyvalue pairs 順序和放入的順序無關, 而且 key 無法重複 LinkedHashMap 使用 hash table 和 linked list 實作 Map, 此集合中 key-value pairs 順序就是放入的順序, 而 key 同樣無法重複 TreeMap 使用 tree 實作 Map, 此集合中 key-value pairs 順序是依照 key 在集合中的排序而定, 而 key 同樣無法重複 73 實作 Map 介面的具體類別 Hashtable 和 HashMap 的功能差不多, 不同處在於 Hashtable 為 執行緒同步 Properties 為 Hashtable 的延伸類別 Properties 的 key 和 value 應該為 String 型別, 而且使用 setproperty() 和 getproperty() 取代 put() 和 get() 74 37

38 具體類別的整體比較 具體類別 ArrayList LinkedList Vector Stack HashSet LinkedHashSet TreeSet HashMap LinkedHashMap TreeMap Hashtable Properties 直接實作介面 List List List List Set Set SortedSet Map Map SortedMap Map Map 資料結構 array linked list array array hash table hash table linked list tree hash table hash table linked list tree hash table hash table 元素重複性可可可可不可不可不可 key 不可 key 不可 key 不可 key 不可 key 不可 元素順序依加入順序依加入順序依加入順序依加入順序無關加入順序依加入順序排序無關加入順序依加入順序依 key 排序無關加入順序無關加入順序 執行緒同步否否是 * 是 * 否否否否否否是 * 是 * 75 1 // Fig : WordTypeCount.java 2 // Program counts the number of occurrences of each word in a string 3 import java.awt.*; 4 import java.awt.event.*; 5 import java.util.*; 6 import javax.swing.*; 7 8 public class WordTypeCount extends JFrame { 9 private JTextArea inputfield; 10 private JLabel prompt; 11 private JTextArea display; 12 private JButton gobutton; private Map map; public WordTypeCount() 17 { 18 super( "Word Type Count" ); 19 inputfield = new JTextArea( 3, 20 ); map = new HashMap(); gobutton = new JButton( "Go" ); 24 gobutton.addactionlistener( 25 MapTest.java Line 21 38

39 26 new ActionListener() { // inner class public void actionperformed( ActionEvent event ) 29 { 30 createmap(); 31 display.settext( createoutput() ); 32 } } // end inner class ); // end call to addactionlistener prompt = new JLabel( "Enter a string:" ); 39 display = new JTextArea( 15, 20 ); 40 display.seteditable( false ); JScrollPane displayscrollpane = new JScrollPane( display ); // add components to GUI 45 Container container = getcontentpane(); 46 container.setlayout( new FlowLayout() ); 47 container.add( prompt ); 48 container.add( inputfield ); 49 container.add( gobutton ); 50 container.add( displayscrollpane ); 51 MapTest.java 52 setsize( 400, 400 ); 53 show(); } // end constructor // create map from user input 58 private void createmap() 59 { 60 String input = inputfield.gettext(); 61 StringTokenizer tokenizer = new StringTokenizer( input ); while ( tokenizer.hasmoretokens() ) { 64 String word = tokenizer.nexttoken().tolowercase(); // get word // if the map contains the word 67 if ( map.containskey( word ) ) { Integer count = (Integer) map.get( word ); // get value // increment value 72 map.put( word, new Integer( count.intvalue() + 1 ) ); 73 } 74 else // otherwise add word with a value of 1 to map 75 map.put( word, new Integer( 1 ) ); } // end while } // end method createmap MapTest.java Line 69 Lines 72 and 75 39

40 80 81 // create string containing map values 82 private String createoutput() { 83 StringBuffer output = new StringBuffer( "" ); 84 Iterator keys = map.keyset().iterator(); // iterate through the keys 87 while ( keys.hasnext() ) { 88 Object currentkey = keys.next(); // output the key-value pairs 91 output.append( currentkey + "\t" + 92 map.get( currentkey ) + "\n" ); 93 } output.append( "size: " + map.size() + "\n" ); 96 output.append( "isempty: " + map.isempty() + "\n" ); return output.tostring(); } // end method createoutput 101 MapTest.java 102 public static void main( String args[] ) 103 { 104 WordTypeCount application = new WordTypeCount(); 105 application.setdefaultcloseoperation( JFrame.EXIT_ON_CLOSE ); 106 } } // end class WordTypeCount MapTest.java 40

41 Synchronization Wrappers Built-in collections are unsynchronized Concurrent access to a Collection can cause errors Java provides synchronization wrappers to avoid this Via set of public static methods public static method header Collection synchronizedcollection( Collection c ) List synchronizedlist( List alist ) Set synchronizedset( Set s ) SortedSet synchronizedsortedset( SortedSet s ) Map synchronizedmap( Map m ) SortedMap synchronizedsortedmap( SortedMap m ) Fig Synchronization wrapper methods. 81 Unmodifiable Wrappers Unmodifiable wrappers Converting collections to unmodifiable collections Throw UnsorrtedOperationException if attempts are made to modify the collection public static method header Collection unmodifiablecollection( Collection c ) List unmodifiablelist( List alist ) Set unmodifiableset( Set s ) SortedSet unmodifiablesortedset( SortedSet s ) Map unmodifiablemap( Map m ) SortedMap unmodifiablesortedmap( SortedMap m ) Fig Unmodifiable wrapper methods

42 Abstract Implementations Abstract implementations Offer bare bones implementation of collection interfaces Programmers can flesh out customizable implementations AbstractCollection AbstractList AbstractMap AbstractSequentialList AbstractSet 83 42

Microsoft PowerPoint - chap13.ppt

Microsoft PowerPoint - chap13.ppt 第 13 章集合 資訊科技系 林偉川 集合 了解 Collection 具體類別所使用的基本資料結構熟悉 Collection Framework 介面的繼承架構熟悉各個 Collection 具體類別的特性及應用熟悉 Generic 了解 Arrays 與 Collections 類別的常用方法了解覆蓋 equals() 方法的規則了解 equals() 和 hashcode() 之間的關係了解

More information

javaexample-02.pdf

javaexample-02.pdf n e w. s t a t i c s t a t i c 3 1 3 2 p u b l i c p r i v a t e p r o t e c t e d j a v a. l a n g. O b j e c t O b j e c t Rect R e c t x 1 y 1 x 2 y 2 R e c t t o S t r i n g ( ) j a v a. l a n g. O

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes What is a JavaBean? JavaBean Java JavaBean Java JavaBean JComponent tooltiptext font background foreground doublebuffered border preferredsize minimumsize maximumsize JButton. Swing JButton JButton() JButton(String

More information

EJB-Programming-4-cn.doc

EJB-Programming-4-cn.doc EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session

More information

Chapter 9: Objects and Classes

Chapter 9: Objects and Classes Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum

More information

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B 25 9 2008 9 M ICROEL ECTRON ICS & COMPU TER Vol. 25 No. 9 September 2008 J ava 1,2, 1,2, 1,2 (1, 330022 ; 2, 330022) :,. Apla - Java,,.. : PAR ;Apla - Java ; ;CMP ; : TP311 : A : 1000-7180 (2008) 09-0018

More information

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2

More information

Swing-02.pdf

Swing-02.pdf 2 J B u t t o n J T e x t F i e l d J L i s t B u t t o n T e x t F i e l d L i s t J F r a m e 21 2 2 Swing C a n v a s C o m p o n e n t J B u t t o n AWT // ToolbarFrame1.java // java.awt.button //

More information

基于CDIO一体化理念的课程教学大纲设计

基于CDIO一体化理念的课程教学大纲设计 Java 语 言 程 序 设 计 课 程 教 学 大 纲 Java 语 言 程 序 设 计 课 程 教 学 大 纲 一 课 程 基 本 信 息 1. 课 程 代 码 :52001CC022 2. 课 程 名 称 :Java 语 言 程 序 设 计 3. 课 程 英 文 名 称 :Java Programming 4. 课 程 类 别 : 理 论 课 ( 含 实 验 上 机 或 实 践 ) 5. 授

More information

3.1 num = 3 ch = 'C' 2

3.1 num = 3 ch = 'C' 2 Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:

More information

Microsoft Word - Book9

Microsoft Word - Book9 葬 書 ( 下 ) 佈 陣 十 方 成 立 指 揮 中 心 層 巒 疊 障 千 山 翠 微, 紓 回 連 綿 的 重 山 復 重 山, 侍 朝 衛 迎, 前 後 有 序, 巋 巘 隱 逸 著 一 片 風 水 寶 地, 牛 臥 馬 馳, 鸞 飛 鳳 舞, 滕 蛇 委 蛇, 縈 藟 纏 繞 在 葺 襲 的 斷 續 峰 巒 之 間! 離 正 午 十 二 時 整 還 有 半 個 鐘 頭, 接 近 天 頂 的

More information

untitled

untitled 1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 [email protected] www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立

More information

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit Tomcat Web JUnit Cactus JUnit Java Cactus JUnit 26.1 JUnit Java JUnit JUnit Java JSP Servlet JUnit Java Erich Gamma Kent Beck xunit JUnit boolean JUnit Java JUnit Java JUnit Java 26.1.1 JUnit JUnit How

More information

Microsoft PowerPoint - Lecture7II.ppt

Microsoft PowerPoint - Lecture7II.ppt Lecture 8II SUDOKU PUZZLE SUDOKU New Play Check 軟體實作與計算實驗 1 4x4 Sudoku row column 3 2 } 4 } block 1 4 軟體實作與計算實驗 2 Sudoku Puzzle Numbers in the puzzle belong {1,2,3,4} Constraints Each column must contain

More information

Microsoft Word - 01.DOC

Microsoft Word - 01.DOC 第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的

More information

C++ 程式設計

C++ 程式設計 C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004

More information

穨control.PDF

穨control.PDF TCP congestion control yhmiu Outline Congestion control algorithms Purpose of RFC2581 Purpose of RFC2582 TCP SS-DR 1998 TCP Extensions RFC1072 1988 SACK RFC2018 1996 FACK 1996 Rate-Halving 1997 OldTahoe

More information

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY

More information

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO Car DVD New GUI IR Flow User Manual V0.1 Jan 25, 2008 19, Innovation First Road Science Park Hsin-Chu Taiwan 300 R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 Web: www.sunplus.com Important Notice SUNPLUS

More information

coverage2.ppt

coverage2.ppt Satellite Tool Kit STK/Coverage STK 82 0715 010-68745117 1 Coverage Definition Figure of Merit 2 STK Basic Grid Assets Interval Description 3 Grid Global Latitude Bounds Longitude Lines Custom Regions

More information

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F 1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o

More information

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO

雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO CHAPTER 使用 Hadoop 打造自己的雲 8 8.3 測試 Hadoop 雲端系統 4 Nodes Hadoop Map Reduce Hadoop WordCount 4 Nodes Hadoop Map/Reduce $HADOOP_HOME /home/ hadoop/hadoop-0.20.2 wordcount echo $ mkdir wordcount $ cd wordcount

More information

Improved Preimage Attacks on AES-like Hash Functions: Applications to Whirlpool and Grøstl

Improved Preimage Attacks on AES-like Hash Functions: Applications to Whirlpool and Grøstl SKLOIS (Pseudo) Preimage Attack on Reduced-Round Grøstl Hash Function and Others Shuang Wu, Dengguo Feng, Wenling Wu, Jian Guo, Le Dong, Jian Zou March 20, 2012 Institute. of Software, Chinese Academy

More information

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986

More information

Microsoft Word - ch04三校.doc

Microsoft Word - ch04三校.doc 4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear

More information

javac: 负 责 的 是 编 译 的 部 分, 当 执 行 javac 时, 会 启 动 java 的 编 译 器 程 序 对 指 定 扩 展 名 的.java 文 件 进 行 编 译 生 成 了 jvm 可 以 识 别 的 字 节 码 文 件 也 就 是 class 文 件, 也 就 是 ja

javac: 负 责 的 是 编 译 的 部 分, 当 执 行 javac 时, 会 启 动 java 的 编 译 器 程 序 对 指 定 扩 展 名 的.java 文 件 进 行 编 译 生 成 了 jvm 可 以 识 别 的 字 节 码 文 件 也 就 是 class 文 件, 也 就 是 ja Java 基 础 知 识 总 结 一 :java 概 述 : 1,JDK:Java Development Kit,java 的 开 发 和 运 行 环 境,java 的 开 发 工 具 和 jre 2,JRE:Java Runtime Environment,java 程 序 的 运 行 环 境,java 运 行 的 所 需 的 类 库 +JVM(java 虚 拟 机 ) 3, 配 置 环 境 变

More information

java2d-4.PDF

java2d-4.PDF 75 7 6 G r a d i e n t P a i n t B a s i c S t r o k e s e t P a i n t ( ) s e t S t o r k e ( ) import java.awt.*; import java.awt.geom.*; public class PaintingAndStroking extends ApplicationFrame { public

More information

Microsoft PowerPoint - Model Checking a Lazy Concurrent List-Based Set Algorithm.ppt [Compatibility Mode]

Microsoft PowerPoint - Model Checking a Lazy Concurrent List-Based Set Algorithm.ppt [Compatibility Mode] Model Checking a Lazy Concurrent List-Based Set Algorithm ZHANG Shaojie, LIU Yang National University of Singapore Agenda Introduction Background Ourapproach Overview Linearizabilitydefinition Modelinglanguage

More information

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10

1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1

More information

States and capital package

States and capital package : 1 Students are required to know 50 states and capitals and their geological locations. This is an independent working packet to learn about 50 states and capital. Students are asked to fulfill 4 activities

More information

JavaIO.PDF

JavaIO.PDF O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException

More information

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING 前言 - Andrew Payne 目录 1 2 Firefly Basics 3 COMPONENT TOOLBOX 目录 4 RESOURCES 致谢

More information

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

KillTest 质量更高 服务更好 学习资料   半年免费更新服务 KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 1Z0-854 Title : Java Standard Edition 5 Programmer Certified Professional Upgrade Exam Version : Demo 1 / 12 1.Given: 20. public class CreditCard

More information

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f 27 1 Vol.27 No.1 CEMENTED CARBIDE 2010 2 Feb.2010!"!!!!"!!!!"!" doi:10.3969/j.issn.1003-7292.2010.01.011 OPC 1 1 2 1 (1., 412008; 2., 518052), OPC, WinCC VB,,, OPC ; ;VB ;WinCC Application of OPC Technology

More information

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点

OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double x) { d

More information

Microsoft Word - 09.數學136-281.docx

Microsoft Word - 09.數學136-281.docx 136. 計 算 梯 型 面 積 (1 分 ) 請 以 JAVA 運 算 式 計 算 下 面 梯 形 面 積, 並 輸 出 面 積 結 果 梯 形 面 積 公 式 為 :( 上 底 + 下 底 ) 高 2 每 一 組 依 序 分 別 輸 入 梯 形 的 上 底 下 底 及 高 的 整 數 輸 出 梯 形 面 積 輸 入 輸 出 94 190 120 99 54 47 137. 計 算 三 角 形 面

More information

untitled

untitled 1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override

More information

软件测试(TA07)第一学期考试

软件测试(TA07)第一学期考试 一 判 断 题 ( 每 题 1 分, 正 确 的, 错 误 的,20 道 ) 1. 软 件 测 试 按 照 测 试 过 程 分 类 为 黑 盒 白 盒 测 试 ( ) 2. 在 设 计 测 试 用 例 时, 应 包 括 合 理 的 输 入 条 件 和 不 合 理 的 输 入 条 件 ( ) 3. 集 成 测 试 计 划 在 需 求 分 析 阶 段 末 提 交 ( ) 4. 单 元 测 试 属 于 动

More information

Mac Java import com.apple.mrj.*;... public class MyFirstApp extends JFrame implements ActionListener, MRJAboutHandler, MRJQuitHandler {... public MyFirstApp() {... MRJApplicationUtils.registerAboutHandler(this);

More information

区 域 活 动 进 入 中 班 我 们 区 域 的 设 置 和 活 动 材 料 都 有 所 变 化, 同 时 也 吸 引 孩 子 们 积 极 的 参 与 学 习 操 作 区 的 新 材 料 他 们 最 喜 欢, 孩 子 们 用 立 方 块 进 行 推 理 操 作 用 扑 克 牌 进 行 接 龙 游

区 域 活 动 进 入 中 班 我 们 区 域 的 设 置 和 活 动 材 料 都 有 所 变 化, 同 时 也 吸 引 孩 子 们 积 极 的 参 与 学 习 操 作 区 的 新 材 料 他 们 最 喜 欢, 孩 子 们 用 立 方 块 进 行 推 理 操 作 用 扑 克 牌 进 行 接 龙 游 日 常 生 活 本 月 我 们 日 常 生 活 活 动 的 重 点 :1. 让 孩 子 养 成 良 好 的 生 活 习 惯, 注 重 生 活 细 节 如 : 在 换 好 鞋 子 后 能 将 鞋 子 整 齐 的 摆 放 进 鞋 架 坐 在 椅 子 上 换 鞋 正 确 的 收 放 椅 子 等 2 让 孩 子 有 自 我 照 顾 的 意 识 如, 让 孩 子 感 受 自 己 的 冷 热 并 告 知 老 师,

More information

Microsoft PowerPoint - course2.ppt

Microsoft PowerPoint - course2.ppt Java 程 式 設 計 基 礎 班 (2) 莊 坤 達 台 大 電 信 所 網 路 資 料 庫 研 究 室 Email: [email protected] Class 2 1 回 顧 Eclipse 使 用 入 門 Class 2 2 Lesson 2 Java 程 式 語 言 介 紹 Class 2 3 Java 基 本 知 識 介 紹 大 小 寫 有 差 (Case Sensitive)

More information

Preface This guide is intended to standardize the use of the WeChat brand and ensure the brand's integrity and consistency. The guide applies to all d

Preface This guide is intended to standardize the use of the WeChat brand and ensure the brand's integrity and consistency. The guide applies to all d WeChat Search Visual Identity Guidelines WEDESIGN 2018. 04 Preface This guide is intended to standardize the use of the WeChat brand and ensure the brand's integrity and consistency. The guide applies

More information

untitled

untitled JavaEE+Android - 6 1.5-2 JavaEE web MIS OA ERP BOSS Android Android Google Map office HTML CSS,java Android + SQL Sever JavaWeb JavaScript/AJAX jquery Java Oracle SSH SSH EJB+JBOSS Android + 1. 2. IDE

More information

C/C++语言 - C/C++数据

C/C++语言 - C/C++数据 C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;

More information

epub83-1

epub83-1 C++Builder 1 C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r C + + B u i l d e r 1.1 1.1.1 1-1 1. 1-1 1 2. 1-1 2 A c c e s s P a r a d o x Visual FoxPro 3. / C / S 2 C + + B u i l d e r / C

More information

一 課 後 社 團 名 稱 :B02. 直 排 輪 校 隊 C 班 ( 校 隊 班 ) 二 授 課 教 師 : 劉 輔 人 助 教 : 杜 翊 嘉 2011 2013 世 界 盃 滑 輪 溜 冰 錦 標 賽 世 界 冠 軍 榮 獲 VOUGE 時 尚 雜 誌 專 訪 同 週 一 校 隊 班 介 紹

一 課 後 社 團 名 稱 :B02. 直 排 輪 校 隊 C 班 ( 校 隊 班 ) 二 授 課 教 師 : 劉 輔 人 助 教 : 杜 翊 嘉 2011 2013 世 界 盃 滑 輪 溜 冰 錦 標 賽 世 界 冠 軍 榮 獲 VOUGE 時 尚 雜 誌 專 訪 同 週 一 校 隊 班 介 紹 一 課 後 社 團 名 稱 :B01. 直 排 輪 綜 合 B 班 ( 綜 合 班 ) 二 授 課 教 師 : 郭 佳 佩 助 教 : 同 週 一 校 隊 B 班 介 紹 同 週 一 綜 合 A 班 第 1 週 同 週 一 綜 合 A 班 第 2 週 同 週 一 綜 合 A 班 第 3 週 同 週 一 綜 合 A 班 第 4 週 同 週 一 綜 合 A 班 第 5 週 同 週 一 綜 合 A 班 第

More information

Microsoft Word - template.doc

Microsoft Word - template.doc HGC efax Service User Guide I. Getting Started Page 1 II. Fax Forward Page 2 4 III. Web Viewing Page 5 7 IV. General Management Page 8 12 V. Help Desk Page 13 VI. Logout Page 13 Page 0 I. Getting Started

More information

摘 要 張 捷 明 是 台 灣 當 代 重 要 的 客 語 兒 童 文 學 作 家, 他 的 作 品 記 錄 著 客 家 人 的 思 想 文 化 與 觀 念, 也 曾 榮 獲 多 項 文 學 大 獎 的 肯 定, 對 台 灣 這 塊 土 地 上 的 客 家 人 有 著 深 厚 的 情 感 張 氏 於

摘 要 張 捷 明 是 台 灣 當 代 重 要 的 客 語 兒 童 文 學 作 家, 他 的 作 品 記 錄 著 客 家 人 的 思 想 文 化 與 觀 念, 也 曾 榮 獲 多 項 文 學 大 獎 的 肯 定, 對 台 灣 這 塊 土 地 上 的 客 家 人 有 著 深 厚 的 情 感 張 氏 於 玄 奘 大 學 中 國 語 文 學 系 碩 士 論 文 客 家 安 徒 生 張 捷 明 童 話 研 究 指 導 教 授 : 羅 宗 濤 博 士 研 究 生 : 黃 春 芳 撰 中 華 民 國 一 0 二 年 六 月 摘 要 張 捷 明 是 台 灣 當 代 重 要 的 客 語 兒 童 文 學 作 家, 他 的 作 品 記 錄 著 客 家 人 的 思 想 文 化 與 觀 念, 也 曾 榮 獲 多 項 文

More information

Open topic Bellman-Ford算法与负环

Open topic   Bellman-Ford算法与负环 Open topic Bellman-Ford 2018 11 5 [email protected] 1/15 Contents 1. G s BF 2. BF 3. BF 2/15 BF G Bellman-Ford false 3/15 BF G Bellman-Ford false G c = v 0, v 1,..., v k (v 0 = v k ) k w(v i 1,

More information

<4D6963726F736F667420506F776572506F696E74202D20B5DAD2BBD5C228B4F2D3A1B0E6292E707074205BBCE6C8DDC4A3CABD5D>

<4D6963726F736F667420506F776572506F696E74202D20B5DAD2BBD5C228B4F2D3A1B0E6292E707074205BBCE6C8DDC4A3CABD5D> Homeworks ( 第 三 版 ):.4 (,, 3).5 (, 3).6. (, 3, 5). (, 4).4.6.7 (,3).9 (, 3, 5) Chapter. Number systems and codes 第 一 章. 数 制 与 编 码 . Overview 概 述 Information is of digital forms in a digital system, and

More information

TX-NR3030_BAS_Cs_ indd

TX-NR3030_BAS_Cs_ indd TX-NR3030 http://www.onkyo.com/manual/txnr3030/adv/cs.html Cs 1 2 3 Speaker Cable 2 HDMI OUT HDMI IN HDMI OUT HDMI OUT HDMI OUT HDMI OUT 1 DIGITAL OPTICAL OUT AUDIO OUT TV 3 1 5 4 6 1 2 3 3 2 2 4 3 2 5

More information

概述

概述 OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3

More information

彩色地图中道路的识别和提取

彩色地图中道路的识别和提取 9310016, i ii Abstract This thesis is on the researching of recognizing the roads in map image by computer. Based on the theory of Pattern Recognition, there is a method to be discussed, which can recognize

More information

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E

Gerotor Motors Series Dimensions A,B C T L L G1/2 M G1/ A 4 C H4 E Gerotor Motors Series Size CC-A Flange Options-B Shaft Options-C Ports Features 0 0 5 5 1 0 1 0 3 3 0 0 SAE A 2 Bolt - (2) 4 Bolt Magneto (4) 4 Bolt Square (H4) 1.0" Keyed (C) 25mm Keyed (A) 1.0' 6T Spline

More information

ebook39-6

ebook39-6 6 first-in-first-out, FIFO L i n e a r L i s t 3-1 C h a i n 3-8 5. 5. 3 F I F O L I F O 5. 5. 6 5. 5. 6.1 [ ] q u e n e ( r e a r ) ( f r o n t 6-1a A 6-1b 6-1b D C D 6-1c a) b) c) 6-1 F I F O L I F ADT

More information

FILTRON 1. DC AC AC 220V 50HZ 2. 1 1 1 3. / / / / 4. 1) 2 3 4 5 6 5. 6. 7. 8. 9. / 10. 1. 2. 3. 4. 5. 6. 7. DC AC FILTRON DC AC FILTRON DC 12V 12VDC D

FILTRON 1. DC AC AC 220V 50HZ 2. 1 1 1 3. / / / / 4. 1) 2 3 4 5 6 5. 6. 7. 8. 9. / 10. 1. 2. 3. 4. 5. 6. 7. DC AC FILTRON DC AC FILTRON DC 12V 12VDC D 2006 4 27 1 JY FILTRON 1. DC AC AC 220V 50HZ 2. 1 1 1 3. / / / / 4. 1) 2 3 4 5 6 5. 6. 7. 8. 9. / 10. 1. 2. 3. 4. 5. 6. 7. DC AC FILTRON DC AC FILTRON DC 12V 12VDC DC FILTRON AC 24VAC 24VAC AC 24VAC AC

More information

Logitech Wireless Combo MK45 English

Logitech Wireless Combo MK45 English Logitech Wireless Combo MK45 Setup Guide Logitech Wireless Combo MK45 English................................................................................... 7..........................................

More information

wedding calendar

wedding calendar W TAIPEI PRESENTS YOUR WEDDING YOUR WAY W SELECTED WEDDING DAY W JANUARY FEBRUARY MARCH APRIL 4 5 6 4 5 6 7 7 8 9 10 11 12 13 8 9 10 11 12 13 14 14 15 16 17 18 19 20 15 16 17 18 19 20 21 21 22 23 24 25

More information

Move Component Object selection Component selection UV Maya Hotkeys editor Maya USING MAYA POLYGONAL MODELING 55

Move Component Object selection Component selection UV Maya Hotkeys editor Maya USING MAYA POLYGONAL MODELING 55 3 55 62 63 Move Component 63 70 72 73 73 Object selection Component selection UV Maya Hotkeys editor Maya 55 USING MAYA POLYGONAL MODELING Maya: Essentials Maya Essentials F8 Ctrl F9 Vertex/Face F9 F10

More information

ebook39-5

ebook39-5 5 3 last-in-first-out, LIFO 3-1 L i n e a r L i s t 3-8 C h a i n 3 3. 8. 3 C + + 5.1 [ ] s t a c k t o p b o t t o m 5-1a 5-1a E D 5-1b 5-1b E E 5-1a 5-1b 5-1c E t o p D t o p D C C B B B t o p A b o

More information

Strings

Strings Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A

More information

Java第一天 2007年4月23日

Java第一天      2007年4月23日 Java 第 一 天 2007 年 4 月 23 日 1 Java 之 父 Golsling 1995 年 5 月 23 日 Java 诞 生 1998 年 12 月 1.2 版 本 Java2 J2SE J2EE J2ME 2004 年 12 月 1.5 版 本 (5.0) Java JavaSE JavaEE JavaME 2 Java SE --- Java 标 准 平 台 Java EE ---

More information

4. 每 组 学 生 将 写 有 习 语 和 含 义 的 两 组 卡 片 分 别 洗 牌, 将 顺 序 打 乱, 然 后 将 两 组 卡 片 反 面 朝 上 置 于 课 桌 上 5. 学 生 依 次 从 两 组 卡 片 中 各 抽 取 一 张, 展 示 给 小 组 成 员, 并 大 声 朗 读 卡

4. 每 组 学 生 将 写 有 习 语 和 含 义 的 两 组 卡 片 分 别 洗 牌, 将 顺 序 打 乱, 然 后 将 两 组 卡 片 反 面 朝 上 置 于 课 桌 上 5. 学 生 依 次 从 两 组 卡 片 中 各 抽 取 一 张, 展 示 给 小 组 成 员, 并 大 声 朗 读 卡 Tips of the Week 课 堂 上 的 英 语 习 语 教 学 ( 二 ) 2015-04-19 吴 倩 MarriottCHEI 大 家 好! 欢 迎 来 到 Tips of the Week! 这 周 我 想 和 老 师 们 分 享 另 外 两 个 课 堂 上 可 以 开 展 的 英 语 习 语 教 学 活 动 其 中 一 个 活 动 是 一 个 充 满 趣 味 的 游 戏, 另 外

More information

chp6.ppt

chp6.ppt Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行

More information

二 Synchronized 1. Java 语 言 的 关 键 字, 当 它 用 来 修 饰 一 个 方 法 或 者 一 个 代 码 块 的 时 候, 能 够 保 证 在 同 一 时 刻 最 多 只 有 一 个 线 程 执 行 该 段 代 码 2. 当 两 个 并 发 线 程 访 问 同 一 个

二 Synchronized 1. Java 语 言 的 关 键 字, 当 它 用 来 修 饰 一 个 方 法 或 者 一 个 代 码 块 的 时 候, 能 够 保 证 在 同 一 时 刻 最 多 只 有 一 个 线 程 执 行 该 段 代 码 2. 当 两 个 并 发 线 程 访 问 同 一 个 Java 基 础 包 括 多 线 程 (Thread 和 Runable 的 区 别 ) 同 步 异 步 (Synchronized) 线 程 池 集 合 序 列 化 反 射 实 例 化 过 程 JDBC 常 用 类 IBatis Java 类 生 命 周 期 Java Web 生 命 周 期 Tomcat 出 去 Http 请 求 过 程 Java 垃 圾 回 收 机 制 Java 性 能 优 化

More information

mvc

mvc Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication

More information

Chapter 16 集合

Chapter 16 集合 Chapter 16 集合 20 ArrayList StringCollection 16 本章學習目標 : ArrayList ArrayList Array StringCollection 16-1 21 10-3-8 System.Array Clear Clear 16-1 Clear System.Array Microsoft System.Collection IList 542

More information

(Microsoft Word - 11-\261i\256m\253i.doc)

(Microsoft Word - 11-\261i\256m\253i.doc) 不 同 接 棒 方 法 對 國 小 學 童 大 隊 接 力 成 績 影 響 之 研 究 不 同 接 棒 方 法 對 國 小 學 童 大 隊 接 力 成 績 影 響 之 研 究 張 峻 詠 林 瑞 興 林 耀 豐 國 立 屏 東 教 育 大 學 摘 要 本 研 究 主 要 目 的 在 探 討 不 同 接 棒 方 法 對 國 小 學 童 大 隊 接 力 成 績 影 響 之 研 究, 以 高 雄 市 楠

More information

K301Q-D VRT中英文说明书141009

K301Q-D VRT中英文说明书141009 THE INSTALLING INSTRUCTION FOR CONCEALED TANK Important instuction:.. Please confirm the structure and shape before installing the toilet bowl. Meanwhile measure the exact size H between outfall and infall

More information

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1

, 7, Windows,,,, : ,,,, ;,, ( CIP) /,,. : ;, ( 21 ) ISBN : -. TP CIP ( 2005) 1 21 , 7, Windows,,,, : 010-62782989 13501256678 13801310933,,,, ;,, ( CIP) /,,. : ;, 2005. 11 ( 21 ) ISBN 7-81082 - 634-4... - : -. TP316-44 CIP ( 2005) 123583 : : : : 100084 : 010-62776969 : 100044 : 010-51686414

More information

Agenda 大 纲 FIFO data-structures 先 进 先 出 ( FIFO) 数 据 结 构 (= First In First Out) Heap data-structures 堆 结 构 Non-static methods 非 静 态 方 法 (= object metho

Agenda 大 纲 FIFO data-structures 先 进 先 出 ( FIFO) 数 据 结 构 (= First In First Out) Heap data-structures 堆 结 构 Non-static methods 非 静 态 方 法 (= object metho Java 编 程 与 算 法 实 用 入 门 A Concise and Practical Introduction to Programming Algorithms in Java Chapter 8: Data-structures and object methods 第 8 章 : 数 据 结 构 和 对 象 的 方 法 1 Agenda 大 纲 FIFO data-structures

More information

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class 踩地雷遊戲 高慧君南港高中 開啟專案 MineSweep 任務一 : 產生 30X20 個磚塊編輯 Table 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.util.arraylist; Write a description of class MyWorld

More information

例 度 讀 讀 不 不 來 念 來 了 讀 不 不 讀 不 讀行 利 了 說 更 了 讀

例 度 讀 讀 不 不 來 念 來 了 讀 不 不 讀 不 讀行 利 了 說 更 了 讀 讀 爛 來 都 力 讀 不 讀 了 讀 來 讀 了 更 不 都 六年 類 更 錄 不 都 便 路 不 不 了 讀 來不 讀 讀 刺 數 不 刺 讀 索 料 易 力 練 讀 易 料 了 讀 力 讀便不 讀 例 度 讀 讀 不 不 來 念 來 了 讀 不 不 讀 不 讀行 利 了 說 更 了 讀 年 來 句 易 說 說 易 說 讀 識 識 力 句 老 錄 朗讀 讀 了 易 臨 說讀 力 識 樂 參 練

More information

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入 100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入

More information

C/C++ 语言 - 循环

C/C++ 语言 - 循环 C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf

More information

Epson

Epson WH / MS CMP0087-00 TC WH/MS EPSON EPSON EXCEED YOUR VISION EXCEED YOUR VISION Seiko Corporation Microsoft and Windows are registered trademarks of Microsoft Corporation. Mac and Mac OS are registered trademarks

More information

AL-M200 Series

AL-M200 Series NPD4754-00 TC ( ) Windows 7 1. [Start ( )] [Control Panel ()] [Network and Internet ( )] 2. [Network and Sharing Center ( )] 3. [Change adapter settings ( )] 4. 3 Windows XP 1. [Start ( )] [Control Panel

More information

ebook140-9

ebook140-9 9 VPN VPN Novell BorderManager Windows NT PPTP V P N L A V P N V N P I n t e r n e t V P N 9.1 V P N Windows 98 Windows PPTP VPN Novell BorderManager T M I P s e c Wi n d o w s I n t e r n e t I S P I

More information

Gerolor Motors Series Dimensions A,B C T L L G1/2 M8 G1/ A 4 C H4 E

Gerolor Motors Series Dimensions A,B C T L L G1/2 M8 G1/ A 4 C H4 E Gerolor Motors Series Size CC-A Flange Options-B Shaft Options-C Ports Features 0 0 12 12 1 1 0 0 2 2 31 31 0 0 SAE A 2 Bolt - (2) 4 Bolt Magneto (4) 4 Bolt Square (H4) 1.0" Keyed (C) 2mm Keyed (A) 1.0'

More information

影視後製全攻略 Premiere Pro After Effects Encore 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS Adobe CS5 Adobe CS4 Premiere Pro After Effect

影視後製全攻略 Premiere Pro After Effects Encore 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS Adobe CS5 Adobe CS4 Premiere Pro After Effect 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS3 2010 Adobe CS5 Adobe CS4 Premiere Pro After Effects Encore 18 ii Tony Cathy 2010/8 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 iii Premiere

More information

四川省普通高等学校

四川省普通高等学校 四 川 省 普 通 高 等 学 校 计 算 机 应 用 知 识 和 能 力 等 级 考 试 考 试 大 纲 (2013 年 试 行 版 ) 四 川 省 教 育 厅 计 算 机 等 级 考 试 中 心 2013 年 1 月 目 录 一 级 考 试 大 纲 1 二 级 考 试 大 纲 6 程 序 设 计 公 共 基 础 知 识 6 BASIC 语 言 程 序 设 计 (Visual Basic) 9

More information

Microsoft PowerPoint - ch02

Microsoft PowerPoint - ch02 第 一 篇 基 礎 圖 文 動 畫 (Basic Graphics / Animation) 2 1 簡 介 2 2 Frame Class 2 3 執 行 緒 繪 圖 流 程 2 4 Font Class 2 5 Color Class 2 6 中 文 處 理 2 7 習 題 (Exercises) 第 二 章 文 字 繪 製 (Words) 2 1 簡 介 本 書 探 討 的 是 動 畫 遊 戲,

More information

Visual Basic D 3D

Visual Basic D 3D Visual Basic 2008 2D 3D 6-1 6-1 - 6-2 - 06 6-2 STEP 1 5-2 (1) STEP 2 5-3 (2) - 6-3 - Visual Basic 2008 2D 3D STEP 3 User1 6-4 (3) STEP 4 User1 6-5 (4) - 6-4 - 06 STEP 5 6-6 (5) 6-3 6-3-1 (LoginForm) PictureBox1

More information

Microsoft PowerPoint - STU_EC_Ch08.ppt

Microsoft PowerPoint - STU_EC_Ch08.ppt 樹德科技大學資訊工程系 Chapter 8: Counters Shi-Huang Chen Fall 2010 1 Outline Asynchronous Counter Operation Synchronous Counter Operation Up/Down Synchronous Counters Design of Synchronous Counters Cascaded Counters

More information