1 28 package net.sf.jasperreports.olap.mapping; 29 30 import java.util.Iterator ; 31 32 33 37 public class MemberMapping implements Mapping 38 { 39 private final Member member; 40 private final MemberProperty property; 41 42 public MemberMapping(Member member, MemberProperty property) 43 { 44 this.member = member; 45 this.property = property; 46 } 47 48 public Member getMember() 49 { 50 return member; 51 } 52 53 public MemberProperty getProperty() 54 { 55 return property; 56 } 57 58 public Iterator memberMappings() 59 { 60 return new SingleIt(member); 61 } 62 63 protected static class SingleIt implements Iterator 64 { 65 boolean first; 66 final Object o; 67 68 SingleIt (Object o) 69 { 70 this.o = o; 71 first = true; 72 } 73 74 public void remove() 75 { 76 throw new UnsupportedOperationException (); 77 } 78 79 public boolean hasNext() 80 { 81 boolean next = first; 82 first = false; 83 return next; 84 } 85 86 public Object next() 87 { 88 return o; 89 } 90 } 91 } 92 | Popular Tags |