1 28 29 package org.objectweb.util.ref.lib; 30 31 import java.util.Vector ; 32 33 import org.objectweb.util.ref.api.Referencable; 34 35 41 abstract public class ReferencableBase 42 implements Referencable 43 { 44 50 51 private Vector referenced_by_; 52 53 59 60 public ReferencableBase() { 61 referenced_by_ = new Vector (); 63 } 64 65 71 77 84 public abstract String getIdentity(); 85 86 92 98 public int getReferencedByCounter() { 99 return referenced_by_.size(); 100 } 101 102 107 public Referencable[] getReferencedBy() { 108 return (Referencable[])referenced_by_.toArray(new Referencable[0]); 109 } 110 111 118 public void addReferencedBy(Referencable ref) { 119 referenced_by_.addElement(ref); 120 } 121 122 130 public void removeReferencedBy(Referencable ref) { 131 referenced_by_.removeElement(ref); 132 } 133 } 134 | Popular Tags |