net.sf.jga.util

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jga Generic Algorithms » net.sf.jga.util 
net.sf.jga.util
Provides Facade objects for working with the algorithm functors, and a variety of utility iterators for various purposes.

The functionality that is adapted from STL is provided by a set of functors in the net.sf.jga.fn.algorithm package operate on iterators. To ease the transition to this approach, there are two facade objects whose methods correspond to the algorithms provided by STL.

The first, Algorithms, operates on collections, and is appropriate for getting easy answers to common questions over collections. The second, Iterators, is closer conceptually to the implementation, and is more appropriate if the same function is to be called several times for a given collection. Most of the methods in these two facades are a single logical statement (although sometimes the singe statement is broken up for formatting reasons) that constructs and invokes the appropriate algorithm functor.

The summary of the functions adapted from STL is as follows:
STL Function nameFacade method namefunctor
accumulate()accumulate()Accumulate
adjacentDiff()adjacentDiff()TransformAdjacent(Minus)
adjacent_find()findAdjacent()FindAdjacent
count()count()Count
count_if()count()Count
equal()equal()varies based on form (3)
find()find()Find
find_first_of()findElement()FindElement
find_if()find()Find
for_each()forEach()ForEach (2)
lexicographical_compare()lessThan()varies based on form (3)
max()maximum()Find,MaxValue (4)
max_element()maximumValue()MaxValue [collection]
Accumulate [iteration]
merge()merge()Merge
min()minimum()Find,MinValue (4)
min_element()minimumValue()MaxValue [collection]
Accumulate [iteration]
mismatch()mismatch()FindMismatch
remove()removeAlln/a(5)
remove_if()removeAllRemoveAll
remove_copy()removeAllCopyRemoveAll(6)
remove_copy_if()removeAllCopyRemoveAll(6)
replace()replaceAlln/a(5)
replace_if()replaceAllReplaceAll
replace_copy()replaceAllCopyReplaceAll(6)
replace_copy_if()replaceAllCopyReplaceAll(6)
search()match()FindSequence
search_n()findRepeated()FindRepeated
transform (unary form)transformCopyTransformUnary
transform (binary form)transformCopyTransformUnary
unique()uniquen/a(5)
unique_copy()uniqueCopyUnique(6)
(2) - The ForEach functor returns the result of the final call to the given functor, where the method returns the given functor.
(3) - The comparison operations are not implemented in terms of functors found in net.sf.jga.fn.algorithm: they are generally implemented via Comparators defined in net.sf.jga.util and comparison functors from net.sf.jga.fn.comparison.
(4) - Only supported for collections, not for iterations. Again, we'd need to be able to clone iterators in order to support them.
(5) - Works with Lists only (not general Collections). The only option available for updating in place is via a ListIterator.
(6) - Unlike C++, the X_copy forms append to the output collection, instead of overwriting it. In C++, the implementations can't assume the right to enlarge the output collection (it might be an array or some other fixed size structure) while in Java, the collections aren't inherently fixed size (if the user passes a fixed size or capped size collection to one of these methods, we'll pass through the appropriate exception, if necessary)

Java Source File NameTypeComment
Algorithms.javaClass Facade for the Algorithms adapted from STL, defined to work primarily with collections.
ArrayIterator.javaClass Iterates over an array of objects.
Arrays.javaClass Miscellaneous utilities for working with arrays.

Copyright © 2004-2005 David A.

ArrayUtils.javaClass Miscellaneous utilities for working with arrays.

Copyright © 2004-2005 David A.

CachingIterator.javaClass Iterator that allows the program to retain the last few elements returned.

Copyright © 2003-2005 David A.

ChainedComparator.javaClass Comparator wrapper that uses a pair of comparators internally.
CollectionUtils.javaClass General utilites for working with collections.
ComparableComparator.javaClass Comparator used for objects that extend Comparable.
EmptyIterator.javaClass Iterator over an empty set of elements.
author:
   David A.
EnumerationIterator.javaClass Adapts an Enumeration to the Iterator and Iterable interfaces.

Copyright © 2003-2005 David A.

FilterIterable.javaClass Produces Iterators that only return elements that meet a given condition.

Copyright © 2005 David A.

FilterIterator.javaClass Iterator that only returns elements that meet the given selection criteria. Note -- in addition to this class being deprecated in order to be moved, its implementation of Iterable is also deprecated: the successor class will not implement Iterable.

Copyright © 2002-2005 David A.

FindAllIterator.javaClass Iterator that applies one of the FindX functors as many times as possible. Formally, this iterator uses a functor that takes one iterator and returns an iterator, and repeatedly applies it to a given iterator until the result iterator's hasNext() method is false.

Copyright © 2004-2005 David A.

FindIterator.javaClass Iterator that provides the ability to skip to the first/next element that meets a particular criteria.

Copyright © 2003-2005 David A.

Formattable.javaInterface Interface for classes that can support the formatting of values via a UnaryFunctor.

Copyright © 2005 David A.

GenericComparator.javaClass Comparator that applies a functor to each argument, then compares the results.
Iterables.javaClass Facade for the Iterators in this package, supporting the new forloop syntax. Only iterators that perform their service during the hasNext()/next() sequence are given in this facade.
IteratorComparator.javaClass Comparator used to compare iterations lexically.
author:
   David A.
Iterators.javaClass Facade for the Algorithms adapted from STL, defined to work primarily with iterators.
LookAheadIterator.javaClass Iterator that allows the program to look at and operate on the next few elements without consuming them.

Copyright © 2003-2005 David A.

MergeIterable.javaClass Produces iterators over the combined contents of two iterables. Iterator that merges the contents of two input iterators.

Copyright © 2005 David A.

MergeIterator.javaClass Iterator that merges the contents of two input iterators. Note -- in addition to this class being deprecated in order to be moved, its implementation of Iterable is also deprecated: the successor class will not implement Iterable.

Copyright © 2003-2005 David A.

NullComparator.javaClass Comparator Decorator used to gracefully compare null and non-null values. In most cases, passing a null to a Comparator results in a NullPointerException, as (in the general case) null is not part of a class' strict ordering. However, in many applications, null objects must be included in an ordering. This wrapper can be used to shield an underlying Comparator from dealing with where in the ordering null values should fall.

A flag is provided that determines whether nulls are less than non-nulls, (the default case) or greater than non-nulls.

SingletonIterator.javaClass Iterates over a single item.
StringTokenizerIterator.javaClass Adapts a StringTokenizer to the Iterator interface.

Copyright © 2003-2005 David A.

TransformAdjacentIterator.javaClass Iterator that applies a given BinaryFunctor to successive pairs of elements from a given iterator, returning the results as elements. Note -- in addition to this class being deprecated in order to be moved, its implementation of Iterable is also deprecated: the successor class will not implement Iterable.

Copyright © 2004-2005 David A.

TransformBinaryIterator.javaClass Iterator that returns the results of applying the given functor to corresponding elements of two given iterators.
TransformIterator.javaClass Iterator that returns the results of applying the given functor to the elements of the given iterator. Note -- in addition to this class being deprecated in order to be moved, its implementation of Iterable is also deprecated: the successor class will not implement Iterable.

Copyright © 2002-2005 David A.

UniqueIterable.javaClass Produces iterators that will not return the same element twice in succession.

Copyright © 2005 David A.

UniqueIterator.javaClass Iterator that will not return the same element twice in succession. Note -- in addition to this class being deprecated in order to be moved, its implementation of Iterable is also deprecated: the successor class will not implement Iterable.

Copyright © 2003-2005 David A.

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.