F

factorials

Biglnteger class, 241-243 factory methods see also constructors Breaklterator class, 409 Calendar class, 417 Collator class, 413 DateFormat class, 424 NumberFormat class, 421 ResourceBundle class, 401 TimeZone class, 417, 425 fail-fast behavior

ArrayList/LinkedList classes, 327 false reserved word

Boolean literal, 49 Field class, 275 fields, 45-58, 94 accessing, 87-89 class fields, 48 declaring in classes, 45-48 enhancing an enum, 216, 217 flat file database, 467 getDeclaredFields method, 271 getFields method, 271 initialization order, 82 initializing array-based fields, 50 initializing in classes, 48-57 initializing instance fields, 75 naming convention for, 45 read-only class field, 57 read-only fields, 57-58 read-only instance fields, 57 types, 45

variable declared within class, 467 File class canExecute method, 456 canRead method, 454 canWrite method, 454 compareTo method, 462 comparing two File objects, 462 constructors, 450, 451 createNewFile method, 459 createTempFile method, 459, 460 delete method, 459 deleteOnExit method, 459, 460 equals method, 462 exists method, 454 getAbsoluteFile method, 452 getAbsolutePath method, 452 getCanonicalFile method, 452, 462 getCanonicalPath method, 452 getFreeSpace method, 456 getName method, 452, 454 getParent method, 452 getParentFile method, 452 getPath method, 452, 454 getTotalSpace method, 456 getUsableSpace method, 456 hashCode method, 462 I/O, 449-462 isAbsolute method, 453 isDirectory method, 454 isFile method, 454 isHidden method, 454 lastModified method, 455

length method, 455

list method, 456, 457

listFiles method, 456, 457, 458

listRoots method, 449

logging library using packages, 157

methods for creating and manipulating files, 459 learning about file or directory, 454 learning about stored pathname, 452 obtaining directory content, 456 mkdir method, 459 mkdirs method, 459 renameTo method, 460 setExecutable method, 461 setLastModified method, 460 setReadable method, 461 setReadOnly method, 460 setWritable method, 461 toString method, 453 file descriptors getFD method, 464 file pointers getFilePointer method, 464 RandomAccessFile class, 464 FileDescriptor class, 466 FileFilter interface, 458 FilelnputStream class, 174, 479-481 close method, 481, 488, 491 read method, 488, 489, 490, 491, 492 FilenameFilter interface, 458

accept method, 457 FileNotFoundException, 170, 171, 174, 176,

463, 479, 519 FileOutputStream class, 174, 479

close method, 488 FileReader class, 520-522 files encoding property, 514 isFile method, 454 metadata, 463

methods for creating and manipulating, 459

methods for learning about, 454 obtaining file information, 455 Files tab, NetBeans IDE, 15 filesystem roots, 449 FileUtils class, 522 FileWriter class, 518-520

methods, 519 fill method, Arrays, 370 FilterlnputStream class, 488, 491

FilterOutputStream class, 485 chaining streams together, 488 subclassing, 485, 486 write method, 485, 486, 492 final reserved word constructors, 75 extending final class, 98 overriding final method, 101 read-only class field, 57 read-only fields, 57 final rethrow, catch clause, 172 finalization runFinalization method, 285 finalize method Enum class, 220 Object class, 103, 109-110, 257 resurrection, 264 finally clause, 172-176, 179 finally reserved word, 172

finalize method, 110 find method, Matcher, 437, 438, 522 FindAll application, 520 findAll method, 521, 522 first method

Breaklterator class, 410 SortedSet interface, 340 first-class function, 148 first-in, first-out (FIFO) queue, 346 firstKey method, SortedMap, 367 flags method, Pattern, 435 flat file database, 467-472 Float class, 251-254

methods, 252 floating-point literal, 50 Floating-point type, 46 getFloat method, 275 nextFloat method, 433 floating-point values

BigDecimal class, 234 floatTolntBits method, 252 floatValue method, 252 FLOOR constant, RoundingMode enum, 238 floor method, Math, 228 flush method

OutputStream class, 475, 476 PrintStream class, 511 following method, Breaklterator, 410 for loops, 66-67

breaking out of nested for loops, 72 continuing, 72 enhanced statement, 322

for reserved word, 66

form feed, escape sequence for, 49

Format class, 421

format method

Format class, 421 MessageFormat class, 427 NumberFormat class, 235 format specifiers, 509 Formatter class, 511 formatters, 421-428

date formatters, 424-425 message formatters, 426-428 number formatters, 421-424 forName method, 270, 272, 273, 277

processing annotations, 199 forwarding methods, 114 Four of a Kind application, 20-40 compiling, 37 distributing, 39 problem domain, 21 running, 37 Four of a Kind game, 20-40 Card enum, 25 Card object, 26, 28 converting pseudocode to Java code,

23-36 deal method, 28 Deck class, 26, 28 DiscardPile class, 28, 29 isEmpty method, 28 Javadoc comments, 25

extracting comments from code, 35 leastDesirableCard method, 34 modeling in pseudocode, 21-23 object of the game, 21 ordinal method, 34 playing Four of a Kind, 21 putBack method, 28 Rank enum, 26, 34 rank method, 26 rankCounts array, 34 setTopCard method, 29 shuffle method, 28 Suit enum, 26 suit method, 26 topCard method, 29 FourOfAKind class, 30 framework, collections, 315 free variable, 148 FULL constant, DateFormat, 424 functions first-class function, 148 Future interface, 385 FutureTask class, 386

Was this article helpful?

0 0

Post a comment