KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > TraversedReferencesImpl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object;
5
6 import java.util.ArrayList JavaDoc;
7 import java.util.Collection JavaDoc;
8 import java.util.Iterator JavaDoc;
9
10 public class TraversedReferencesImpl implements TraversedReferences {
11
12   private final Collection JavaDoc references = new ArrayList JavaDoc();
13   
14   public void addAnonymousReference(Object JavaDoc o) {
15     references.add(new AnonymousTraversedReference(o));
16   }
17   
18   public void addNamedReference(String JavaDoc className, String JavaDoc fieldName, Object JavaDoc value) {
19     references.add(new NamedTraversedReference(className, fieldName, value));
20   }
21
22   public void addNamedReference(String JavaDoc fullyQualifiedFieldName, Object JavaDoc value) {
23     references.add(new NamedTraversedReference(fullyQualifiedFieldName, value));
24   }
25
26   public Iterator JavaDoc iterator() {
27     return references.iterator();
28   }
29
30 }
31
Popular Tags