EMMA Coverage Report (generated Tue Oct 27 11:32:50 PDT 2009)
[all classes][net.spy.memcached.protocol.ascii]

COVERAGE SUMMARY FOR SOURCE FILE [AsciiOperationFactory.java]

nameclass, %method, %block, %line, %
AsciiOperationFactory.java100% (1/1)100% (14/14)100% (119/119)100% (18/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AsciiOperationFactory100% (1/1)100% (14/14)100% (119/119)100% (18/18)
AsciiOperationFactory (): void 100% (1/1)100% (3/3)100% (1/1)
cas (StoreType, String, long, int, int, byte [], OperationCallback): CASOpera... 100% (1/1)100% (10/10)100% (1/1)
cat (ConcatenationType, long, String, byte [], OperationCallback): Concatenat... 100% (1/1)100% (8/8)100% (1/1)
cloneGet (KeyedOperation): Collection 100% (1/1)100% (34/34)100% (5/5)
delete (String, OperationCallback): DeleteOperation 100% (1/1)100% (6/6)100% (1/1)
flush (int, OperationCallback): FlushOperation 100% (1/1)100% (6/6)100% (1/1)
get (Collection, GetOperation$Callback): GetOperation 100% (1/1)100% (6/6)100% (1/1)
get (String, GetOperation$Callback): GetOperation 100% (1/1)100% (6/6)100% (1/1)
gets (String, GetsOperation$Callback): GetsOperation 100% (1/1)100% (6/6)100% (1/1)
mutate (Mutator, String, int, long, int, OperationCallback): MutatorOperation 100% (1/1)100% (8/8)100% (1/1)
noop (OperationCallback): NoopOperation 100% (1/1)100% (5/5)100% (1/1)
stats (String, StatsOperation$Callback): StatsOperation 100% (1/1)100% (6/6)100% (1/1)
store (StoreType, String, int, int, byte [], OperationCallback): StoreOperation 100% (1/1)100% (10/10)100% (1/1)
version (OperationCallback): VersionOperation 100% (1/1)100% (5/5)100% (1/1)

1package net.spy.memcached.protocol.ascii;
2 
3import java.util.ArrayList;
4import java.util.Collection;
5 
6import net.spy.memcached.ops.BaseOperationFactory;
7import net.spy.memcached.ops.CASOperation;
8import net.spy.memcached.ops.ConcatenationOperation;
9import net.spy.memcached.ops.ConcatenationType;
10import net.spy.memcached.ops.DeleteOperation;
11import net.spy.memcached.ops.FlushOperation;
12import net.spy.memcached.ops.GetOperation;
13import net.spy.memcached.ops.GetsOperation;
14import net.spy.memcached.ops.KeyedOperation;
15import net.spy.memcached.ops.MultiGetOperationCallback;
16import net.spy.memcached.ops.Mutator;
17import net.spy.memcached.ops.MutatorOperation;
18import net.spy.memcached.ops.NoopOperation;
19import net.spy.memcached.ops.Operation;
20import net.spy.memcached.ops.OperationCallback;
21import net.spy.memcached.ops.StatsOperation;
22import net.spy.memcached.ops.StoreOperation;
23import net.spy.memcached.ops.StoreType;
24import net.spy.memcached.ops.VersionOperation;
25 
26/**
27 * Operation factory for the ascii protocol.
28 */
29public class AsciiOperationFactory extends BaseOperationFactory {
30 
31        public DeleteOperation delete(String key, OperationCallback cb) {
32                return new DeleteOperationImpl(key, cb);
33        }
34 
35        public FlushOperation flush(int delay, OperationCallback cb) {
36                return new FlushOperationImpl(delay, cb);
37        }
38 
39        public GetOperation get(String key, GetOperation.Callback cb) {
40                return new GetOperationImpl(key, cb);
41        }
42 
43        public GetOperation get(Collection<String> keys, GetOperation.Callback cb) {
44                return new GetOperationImpl(keys, cb);
45        }
46 
47        public GetsOperation gets(String key, GetsOperation.Callback cb) {
48                 return new GetsOperationImpl(key, cb);
49        }
50 
51        public MutatorOperation mutate(Mutator m, String key, int by,
52                        long exp, int def, OperationCallback cb) {
53                return new MutatorOperationImpl(m, key, by, cb);
54        }
55 
56        public StatsOperation stats(String arg, StatsOperation.Callback cb) {
57                return new StatsOperationImpl(arg, cb);
58        }
59 
60        public StoreOperation store(StoreType storeType, String key, int flags,
61                        int exp, byte[] data, OperationCallback cb) {
62                return new StoreOperationImpl(storeType, key, flags, exp, data, cb);
63        }
64 
65        public VersionOperation version(OperationCallback cb) {
66                return new VersionOperationImpl(cb);
67        }
68 
69        public NoopOperation noop(OperationCallback cb) {
70                return new VersionOperationImpl(cb);
71        }
72 
73        public CASOperation cas(StoreType type, String key, long casId, int flags,
74                        int exp, byte[] data, OperationCallback cb) {
75                return new CASOperationImpl(key, casId, flags, exp, data, cb);
76        }
77 
78        public ConcatenationOperation cat(ConcatenationType catType,
79                        long casId,
80                        String key, byte[] data, OperationCallback cb) {
81                return new ConcatenationOperationImpl(catType, key, data, cb);
82        }
83 
84        @Override
85        protected Collection<? extends Operation> cloneGet(KeyedOperation op) {
86                Collection<Operation> rv=new ArrayList<Operation>();
87                GetOperation.Callback callback = new MultiGetOperationCallback(
88                                op.getCallback(), op.getKeys().size());
89                for(String k : op.getKeys()) {
90                        rv.add(get(k, callback));
91                }
92                return rv;
93        }
94 
95}

[all classes][net.spy.memcached.protocol.ascii]
EMMA 2.0.5312 (C) Vladimir Roubtsov