[cvs] / jsr166 / src / main / java / util / concurrent / LinkedTransferQueue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29, Sat Sep 11 21:08:29 2010 UTC revision 1.30, Thu Sep 30 01:35:20 2010 UTC
# Line 1175  Line 1175 
1175      }      }
1176    
1177      /**      /**
1178         * Returns {@code true} if this queue contains the specified element.
1179         * More formally, returns {@code true} if and only if this queue contains
1180         * at least one element {@code e} such that {@code o.equals(e)}.
1181         *
1182         * @param o object to be checked for containment in this queue
1183         * @return {@code true} if this queue contains the specified element
1184         */
1185        public boolean contains(Object o) {
1186            if (o == null) return false;
1187            for (Node p = head; p != null; p = succ(p)) {
1188                Object item = p.item;
1189                if (p.isData) {
1190                    if (item != null && item != p && o.equals(item))
1191                        return true;
1192                }
1193                else if (item == null)
1194                    break;
1195            }
1196            return false;
1197        }
1198    
1199        /**
1200       * Always returns {@code Integer.MAX_VALUE} because a       * Always returns {@code Integer.MAX_VALUE} because a
1201       * {@code LinkedTransferQueue} is not capacity constrained.       * {@code LinkedTransferQueue} is not capacity constrained.
1202       *       *

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8