Java Doc for Iterators.java in  » Development » jga-Generic-Algorithms » net » sf » jga » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.jga.util.Iterators

Iterators
public class Iterators (Code)
Facade for the Algorithms adapted from STL, defined to work primarily with iterators. These algorithms are adapted from STL, with modifications to be consistent with typical java practice. For example, typical STL algorithms are defined with pairs of iterators defining a half-open range over some implied collection. It works in C++ because the STL iterators can be compared for equality. Java iterators are not guaranteed to be comparable to each other by contract, so the same signatures wouldn't work.

Typically, where an STL algorithm would take a pair of iterators, this facade will take a single iterator and where an STL algorithm would return an iterator, we'll return an iterator. In this facade, the iterator returned will frequently be specialized in some way: either a ListIterator or one of the iterators defined in jga.

It is best to assume that all of the methods in this class may (but are not guaranteed to) advance the iterator argument. Also, once an iterator has been passed to one of the methods of this class, it should not be used again. On the other hand, unless otherwise noted, it is safe to pass the iterator returned by one of the methods in this class back to the method that returned it, or to any of the other methods.

Copyright © 2003-2005 David A. Hall
author:
   David A. Hall





Method Summary
public static  Taccumulate(Class<T> numtype, Iterator<T> iterator)
     Adds each number in the iterator, returning the sum. the final sum.
public static  Taccumulate(Class<T> numtype, Iterator<T> iterator, BinaryFunctor<T, T, T> bf)
     Applies the binary functor to each number in the iterator, returning the final result.
public static  Taccumulate(Iterator<T> iterator, T initial, BinaryFunctor<T, T, T> bf)
     Applies the binary functor to each element in the iterator, returning the final result.
public static  TransformAdjacentIterator<T, T>adjacentDiff(Class<T> type, Iterator<? extends T> iter)
    
public static  longcount(Iterator<? extends T> iterator, T value)
     Counts the number of occurrences of value in the iteration, using the equals() method of the value.
public static  longcount(Iterator<? extends T> iterator, Equality<T> eq, T value)
     Counts the number of occurrences of value in the iteration, using the given equality operator.
public static  longcount(Iterator<? extends T> iterator, UnaryFunctor<T, Boolean> eq)
     Counts the items in the collection for which the given function returns TRUE.
public static  booleanequal(Iterator<? extends T> iterator1, Iterator<? extends T> iterator2)
     Returns true if the two iterations are equal, using the Comparable interface to compare elements in the iterations.
public static  booleanequal(Iterator<? extends T> iterator1, Iterator<? extends T> iterator2, Comparator<T> comp)
     Returns true if the two iterations are equal, using the given Comparator to compare elements in the iterations.
public static  booleanequal(Iterator<? extends T> iter1, Iterator<? extends T> iter2, BinaryFunctor<T, T, Boolean> eq)
     Returns true if the two iterations are equal, using the given BinaryFunctor to compare elements in the iterations.
public static  FindIterator<T>find(Iterator<? extends T> iterator, T value)
     Finds an arbitrary value in an iteration using the equals() method. an iterator based on the given iterator whose next() [if ithasNext()] will return the next instance of value in the iteration,using the equals() method of the value.
public static  FindIterator<T>find(Iterator<? extends T> iterator, T value, Equality<T> eq)
     Finds an arbitrary value in an iteration using the given Equality operator. an iterator based on the given iterator whose next() [if ithasNext()] will return the next instance of value in the iteration, usingthe given equality operator.
public static  FindIterator<T>find(Iterator<? extends T> iterator, UnaryFunctor<T, Boolean> fn)
     Finds a value in a collection for which the given function returns TRUE. an iterator based on the given iterator whose next() [if ithasNext()] will return the next instance in the iteration for which thegiven function returns true.
public static  LookAheadIterator<T>findAdjacent(Iterator<? extends T> iterator)
     Finds adjacent pairs of equivalent values in an iteration using the equals() method. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of a pair of adjacent values.
public static  LookAheadIterator<T>findAdjacent(Iterator<? extends T> iterator, BinaryFunctor<T, T, Boolean> bf)
     Finds adjacent pairs of equivalent values in an iteration for which the given function returns TRUE. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of a pair of adjacent values.
public static  FindIterator<T>findElement(Iterator<? extends T> iterator, Collection<? extends T> desired)
     Finds any value from the given collection using the collection's contains() method. an iterator based on the given iterator whose next() [if it hasNext()] will returnthe first instance of any value found in the second collection.
public static  FindIterator<T>findElement(Iterator<? extends T> i, Collection<? extends T> c, BinaryFunctor<T, T, Boolean> eq)
     Finds any value from the given collection using the given functor to determine equivalence. Each item in the iteration will be compared to every item in the second collection using the given functor, stopping when the iteration is exhausted or when any pair returns TRUE. an iterator based on the given iterator whose next() [if it hasNext()] will returnthe first instance of any value in the second collection, where equivelency is determinedby the given functor.
public static  LookAheadIterator<T>findRepeated(Iterator<? extends T> iterator, int n, T value)
     Finds arbitrary length runs of a given value in an iteration using the equals() method.
public static  LookAheadIterator<T>findRepeated(Iterator<? extends T> iterator, int n, T value, Equality<T> eq)
     Finds arbitrary length runs of a given value in an iteration using the given equality operator.
public static  LookAheadIterator<T>findRepeated(Iterator<? extends T> iterator, int n, UnaryFunctor<T, Boolean> eq)
     Finds arbitrary length runs of a given value in an iteration for which the given function returns TRUE.
public static  UnaryFunctor<T, R>forEach(Iterator<? extends T> iterator, UnaryFunctor<T, R> fn)
     Applies the given UnaryFunctor to every element in the iteration, and returns the Functor.
public static  booleanlessThan(Iterator<? extends T> iter1, Iterator<? extends T> iter2)
     Returns true if the first iterator is lexically less than the second, using the default comparison operation to compare the elements in each iterator.
public static  booleanlessThan(Iterator<? extends T> iter1, Iterator<? extends T> iter2, Comparator<T> comp)
     Returns true if the first iterator is lexically less than the second, using the given comparator to compare the elements in each iterator.
public static  booleanlessThan(Iterator<? extends T> i1, Iterator<? extends T> i2, BinaryFunctor<T, T, Boolean> lt)
     Returns true if the first iterator is lexically less than the second, using the given operator to compare the elements in each iterator.
public static  LookAheadIterator<T>match(Iterator<? extends T> iterator, Collection<? extends T> pattern)
     Finds the given pattern in the iteration using the equals method. an iterator based on the given iterator whose next() [if ithasNext()] will return the first element of a sequence that matchesthe entire contents of the collection.
public static  LookAheadIterator<T>match(Iterator<? extends T> i, Collection<? extends T> pattern, BinaryFunctor<T, T, Boolean> eq)
     Finds the given pattern in the collection using the given functor to determine equivalence. an iterator based on the given iterator whose next() [if ithasNext()] will return the first element of a sequence that matchesthe entire contents of the collection.
public static  TmaximumValue(Iterator<? extends T> iterator)
     Finds the maximum value in an iteration using the natural ordering of the iterator's elements.
public static  TmaximumValue(Iterator<? extends T> iterator, Comparator<T> comp)
     Finds the maximum value in an iteration using the given comparator.
public static  TmaximumValue(Iterator<? extends T> iterator, BinaryFunctor<T, T, T> bf)
     Finds the maximum value in an iteration using the given functor to compare elements.
public static  MergeIterator<T>merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2)
     Merges two iterations together.
public static  MergeIterator<T>merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2, Comparator<T> comp)
     Merges two iterations together using the given comparator.
public static  TminimumValue(Iterator<? extends T> iterator)
     Finds the minimum value in an iteration using the natural ordering of the iterator's elements.
public static  TminimumValue(Iterator<? extends T> iterator, Comparator<T> comp)
     Finds the minimum value in an iteration using the given comparator.
public static  TminimumValue(Iterator<? extends T> iterator, BinaryFunctor<T, T, T> bf)
     Finds the minimum value in an iteration using the given functor to compare elements.
public static  LookAheadIterator<T>mismatch(Iterator<? extends T> iterator, Collection<? extends T> pattern)
     Finds the point at which two collections differ, using NotEqualTo. an iterator based on the given iterator whose next() [if ithasNext()] will return the first element in the iteration that doesnot equal the corresponding element in the pattern.
public static  LookAheadIterator<T>mismatch(Iterator<? extends T> iterator, Collection<? extends T> pattern, BinaryFunctor<T, T, Boolean> neq)
     Finds the point at which two collections differ, using the given functor an iterator based on the given iterator whose next() [if ithasNext()] will return the first element in the iteration for which thegiven function returns TRUE when given the element and the correspondingelement in the pattern.
public static  FilterIterator<T>removeAll(Iterator<? extends T> iterator, T value)
     Filters an arbitrary value from an iteration using the equals() method.
public static  FilterIterator<T>removeAll(Iterator<? extends T> iterator, T value, Equality<T> eq)
     Filters an arbitrary value from an iteration using the given Equality operator.
public static  FilterIterator<T>removeAll(Iterator<? extends T> iterator, UnaryFunctor<T, Boolean> eq)
     Filters values from an iteration for which the given function returns TRUE.
public static  Iterator<T>replaceAll(Iterator<? extends T> iter, UnaryFunctor<T, Boolean> test, T value)
     Tests each element in an iterator, replacing those for which the test is true with the replacement value.
public static  TransformIterator<T, R>transform(Iterator<? extends T> iter, UnaryFunctor<T, R> uf)
     Applies the UnaryFunctor to each element in the input, returning an iterator over the results.
public static  TransformBinaryIterator<T1, T2, R>transform(Iterator<? extends T1> i1, Iterator<? extends T2> i2, BinaryFunctor<T1, T2, R> bf)
     Applies the BinaryFunctor to corresponding elements of the two input iterators, and returns an iterator over the results.
public static  UniqueIterator<T>unique(Iterator<? extends T> iterator)
     Skips duplicate values in the given iteration.
public static  UniqueIterator<T>unique(Iterator<? extends T> iterator, BinaryFunctor<T, T, Boolean> eq)
     Skips duplicate values in the given iteration.



Method Detail
accumulate
public static T accumulate(Class<T> numtype, Iterator<T> iterator)(Code)
Adds each number in the iterator, returning the sum. the final sum. If the iterator is empty, then zero isreturned



accumulate
public static T accumulate(Class<T> numtype, Iterator<T> iterator, BinaryFunctor<T, T, T> bf)(Code)
Applies the binary functor to each number in the iterator, returning the final result. Along with each number is passed the result of the previous call of the functor (or zero for the first call to the functor). The elements in the iterator are always passed in the 2nd postion. the final result. If the iterator is empty, then zero isreturned



accumulate
public static T accumulate(Iterator<T> iterator, T initial, BinaryFunctor<T, T, T> bf)(Code)
Applies the binary functor to each element in the iterator, returning the final result. Along with each element is passed the result of the previous call of the functor (or the initial value for the first call to the functor). The elements in the iteration are always passed in the 2nd postion. the final result. If the iteration is empty, then the initialvalue is returned



adjacentDiff
public static TransformAdjacentIterator<T, T> adjacentDiff(Class<T> type, Iterator<? extends T> iter)(Code)
an iterator containing the arithemetic difference between succesivepairs of numbers



count
public static long count(Iterator<? extends T> iterator, T value)(Code)
Counts the number of occurrences of value in the iteration, using the equals() method of the value. the number of instances found



count
public static long count(Iterator<? extends T> iterator, Equality<T> eq, T value)(Code)
Counts the number of occurrences of value in the iteration, using the given equality operator. the number of instances found



count
public static long count(Iterator<? extends T> iterator, UnaryFunctor<T, Boolean> eq)(Code)
Counts the items in the collection for which the given function returns TRUE. the number of instances found



equal
public static boolean equal(Iterator<? extends T> iterator1, Iterator<? extends T> iterator2)(Code)
Returns true if the two iterations are equal, using the Comparable interface to compare elements in the iterations. true if the two iterations are equal



equal
public static boolean equal(Iterator<? extends T> iterator1, Iterator<? extends T> iterator2, Comparator<T> comp)(Code)
Returns true if the two iterations are equal, using the given Comparator to compare elements in the iterations. true if the two iterations are equal



equal
public static boolean equal(Iterator<? extends T> iter1, Iterator<? extends T> iter2, BinaryFunctor<T, T, Boolean> eq)(Code)
Returns true if the two iterations are equal, using the given BinaryFunctor to compare elements in the iterations. true if the two iterations are equal



find
public static FindIterator<T> find(Iterator<? extends T> iterator, T value)(Code)
Finds an arbitrary value in an iteration using the equals() method. an iterator based on the given iterator whose next() [if ithasNext()] will return the next instance of value in the iteration,using the equals() method of the value. If the value is not in theiteration, then the returned iterator's hasNext() will report false.



find
public static FindIterator<T> find(Iterator<? extends T> iterator, T value, Equality<T> eq)(Code)
Finds an arbitrary value in an iteration using the given Equality operator. an iterator based on the given iterator whose next() [if ithasNext()] will return the next instance of value in the iteration, usingthe given equality operator. If the value is not in theiteration, then the returned iterator's hasNext() will report false.



find
public static FindIterator<T> find(Iterator<? extends T> iterator, UnaryFunctor<T, Boolean> fn)(Code)
Finds a value in a collection for which the given function returns TRUE. an iterator based on the given iterator whose next() [if ithasNext()] will return the next instance in the iteration for which thegiven function returns true. If the value is not in theiteration, then the returned iterator's hasNext() will report false.



findAdjacent
public static LookAheadIterator<T> findAdjacent(Iterator<? extends T> iterator)(Code)
Finds adjacent pairs of equivalent values in an iteration using the equals() method. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of a pair of adjacent values. If nopair of values exists in the iteration, then the returned iterator'shasNext() will report false.



findAdjacent
public static LookAheadIterator<T> findAdjacent(Iterator<? extends T> iterator, BinaryFunctor<T, T, Boolean> bf)(Code)
Finds adjacent pairs of equivalent values in an iteration for which the given function returns TRUE. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of a pair of adjacent values. If nopair of values exists in the iteration, then the returned iterator'shasNext() will report false.



findElement
public static FindIterator<T> findElement(Iterator<? extends T> iterator, Collection<? extends T> desired)(Code)
Finds any value from the given collection using the collection's contains() method. an iterator based on the given iterator whose next() [if it hasNext()] will returnthe first instance of any value found in the second collection. If no such value is foundin the iteration, then the returned iterator's hasNext() will report false.



findElement
public static FindIterator<T> findElement(Iterator<? extends T> i, Collection<? extends T> c, BinaryFunctor<T, T, Boolean> eq)(Code)
Finds any value from the given collection using the given functor to determine equivalence. Each item in the iteration will be compared to every item in the second collection using the given functor, stopping when the iteration is exhausted or when any pair returns TRUE. an iterator based on the given iterator whose next() [if it hasNext()] will returnthe first instance of any value in the second collection, where equivelency is determinedby the given functor. If no such value is found in the iteration, then the returned iterator'shasNext() will report false.



findRepeated
public static LookAheadIterator<T> findRepeated(Iterator<? extends T> iterator, int n, T value)(Code)
Finds arbitrary length runs of a given value in an iteration using the equals() method. Runs of length zero are well-defined: every iteration begins with a run of length zero of all possible values. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of n adjacent instances of value. If norun of values of the requested length exist in the iteration, then thereturned iterator's hasNext() will report false.



findRepeated
public static LookAheadIterator<T> findRepeated(Iterator<? extends T> iterator, int n, T value, Equality<T> eq)(Code)
Finds arbitrary length runs of a given value in an iteration using the given equality operator. Runs of length zero are well-defined: every iteration begins with a run of length zero of all possible values. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of n adjacent instances of value. If norun of values of the requested length exist in the iteration, then thereturned iterator's hasNext() will report false.



findRepeated
public static LookAheadIterator<T> findRepeated(Iterator<? extends T> iterator, int n, UnaryFunctor<T, Boolean> eq)(Code)
Finds arbitrary length runs of a given value in an iteration for which the given function returns TRUE. Runs of length zero are well-defined: every iteration begins with a run of length zero of all possible values. an iterator based on the given iterator whose next() [if ithasNext()] will return the first of n adjacent instances of value. If norun of values of the requested length exist in the iteration, then thereturned iterator's hasNext() will report false.



forEach
public static UnaryFunctor<T, R> forEach(Iterator<? extends T> iterator, UnaryFunctor<T, R> fn)(Code)
Applies the given UnaryFunctor to every element in the iteration, and returns the Functor. This is useful when the Functor gathers information on each successive call. the functor, after it has been called once for every element



lessThan
public static boolean lessThan(Iterator<? extends T> iter1, Iterator<? extends T> iter2)(Code)
Returns true if the first iterator is lexically less than the second, using the default comparison operation to compare the elements in each iterator. true if the first iteration is less than the second



lessThan
public static boolean lessThan(Iterator<? extends T> iter1, Iterator<? extends T> iter2, Comparator<T> comp)(Code)
Returns true if the first iterator is lexically less than the second, using the given comparator to compare the elements in each iterator. true if the first iteration is less than the second



lessThan
public static boolean lessThan(Iterator<? extends T> i1, Iterator<? extends T> i2, BinaryFunctor<T, T, Boolean> lt)(Code)
Returns true if the first iterator is lexically less than the second, using the given operator to compare the elements in each iterator. The first is less than the second if it is not longer than the second and if the first corresponding element that is not equal is less. true if the first iteration is less than the second



match
public static LookAheadIterator<T> match(Iterator<? extends T> iterator, Collection<? extends T> pattern)(Code)
Finds the given pattern in the iteration using the equals method. an iterator based on the given iterator whose next() [if ithasNext()] will return the first element of a sequence that matchesthe entire contents of the collection. If no such match isfound in the iteration, then the returned iterator's hasNext()will report false. If the pattern is empty, then the iterator will notbe advanced.



match
public static LookAheadIterator<T> match(Iterator<? extends T> i, Collection<? extends T> pattern, BinaryFunctor<T, T, Boolean> eq)(Code)
Finds the given pattern in the collection using the given functor to determine equivalence. an iterator based on the given iterator whose next() [if ithasNext()] will return the first element of a sequence that matchesthe entire contents of the collection. If no such match isfound in the iteration, then the returned iterator's hasNext()will report false. If the pattern is empty, then the iterator will notbe advanced.



maximumValue
public static T maximumValue(Iterator<? extends T> iterator)(Code)
Finds the maximum value in an iteration using the natural ordering of the iterator's elements. the maximum value found in the iteration



maximumValue
public static T maximumValue(Iterator<? extends T> iterator, Comparator<T> comp)(Code)
Finds the maximum value in an iteration using the given comparator. the maximum value found in the iteration



maximumValue
public static T maximumValue(Iterator<? extends T> iterator, BinaryFunctor<T, T, T> bf)(Code)
Finds the maximum value in an iteration using the given functor to compare elements. The functor is presumed to return the lesser of its two arguments. the maximum value found in the iteration



merge
public static MergeIterator<T> merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2)(Code)
Merges two iterations together. Walks both iterators, choosing the lesser of the two current values. an iterator based on the two input iterators that contains theirmerged contents



merge
public static MergeIterator<T> merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2, Comparator<T> comp)(Code)
Merges two iterations together using the given comparator. Walks both iterators, choosing the lesser of the two current values. an iterator based on the two input iterators that contains theirmerged contents



minimumValue
public static T minimumValue(Iterator<? extends T> iterator)(Code)
Finds the minimum value in an iteration using the natural ordering of the iterator's elements. the minimum value found in the iteration



minimumValue
public static T minimumValue(Iterator<? extends T> iterator, Comparator<T> comp)(Code)
Finds the minimum value in an iteration using the given comparator. the minimum value found in the iteration



minimumValue
public static T minimumValue(Iterator<? extends T> iterator, BinaryFunctor<T, T, T> bf)(Code)
Finds the minimum value in an iteration using the given functor to compare elements. The functor is presumed to return the lesser of its two arguments. the minimum value found in the iteration



mismatch
public static LookAheadIterator<T> mismatch(Iterator<? extends T> iterator, Collection<? extends T> pattern)(Code)
Finds the point at which two collections differ, using NotEqualTo. an iterator based on the given iterator whose next() [if ithasNext()] will return the first element in the iteration that doesnot equal the corresponding element in the pattern. If the patternmatches the iteration but is longer, than the returned iterator'shasNext() will report false. If the pattern is empty, then theiteration is not advanced.



mismatch
public static LookAheadIterator<T> mismatch(Iterator<? extends T> iterator, Collection<? extends T> pattern, BinaryFunctor<T, T, Boolean> neq)(Code)
Finds the point at which two collections differ, using the given functor an iterator based on the given iterator whose next() [if ithasNext()] will return the first element in the iteration for which thegiven function returns TRUE when given the element and the correspondingelement in the pattern. If the pattern matches the iteration but islonger, than the returned iterator's hasNext() will report false. If thepattern is empty, then the iteration is not advanced.



removeAll
public static FilterIterator<T> removeAll(Iterator<? extends T> iterator, T value)(Code)
Filters an arbitrary value from an iteration using the equals() method. an iterator based on the given iterator that will return notinclude elements equal to the given value



removeAll
public static FilterIterator<T> removeAll(Iterator<? extends T> iterator, T value, Equality<T> eq)(Code)
Filters an arbitrary value from an iteration using the given Equality operator. an iterator based on the given iterator that will not includeelements that are equal to the value using the given Equality



removeAll
public static FilterIterator<T> removeAll(Iterator<? extends T> iterator, UnaryFunctor<T, Boolean> eq)(Code)
Filters values from an iteration for which the given function returns TRUE. an iterator based on the given iterator that will not includeelements that pass the given test.



replaceAll
public static Iterator<T> replaceAll(Iterator<? extends T> iter, UnaryFunctor<T, Boolean> test, T value)(Code)
Tests each element in an iterator, replacing those for which the test is true with the replacement value.



transform
public static TransformIterator<T, R> transform(Iterator<? extends T> iter, UnaryFunctor<T, R> uf)(Code)
Applies the UnaryFunctor to each element in the input, returning an iterator over the results. an iterator based on the given iterator that will return theresults obtained when passing each element of the input iteration to thegiven unary functor.



transform
public static TransformBinaryIterator<T1, T2, R> transform(Iterator<? extends T1> i1, Iterator<? extends T2> i2, BinaryFunctor<T1, T2, R> bf)(Code)
Applies the BinaryFunctor to corresponding elements of the two input iterators, and returns an iterator over the results. The resulting iterator will have the same number of elements as the shorter of the two input iterations. an iterator that will return the results obtained when passingeach pair of corresponding elements of the input iterations to thegiven binary functor.



unique
public static UniqueIterator<T> unique(Iterator<? extends T> iterator)(Code)
Skips duplicate values in the given iteration. an iterator based on the given iterator that will not return thesame element twice in succession



unique
public static UniqueIterator<T> unique(Iterator<? extends T> iterator, BinaryFunctor<T, T, Boolean> eq)(Code)
Skips duplicate values in the given iteration. an iterator based on the given iterator that will not return thesame element twice in succession, using the given functor to compareelements



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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