summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/VectorProperty.java
blob: d5e3d7786c26279682f2a2fb8bf33a472f0e4220 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import java.util.Enumeration;
/*    */ import java.util.Hashtable;
/*    */ import java.util.Vector;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class VectorProperty
/*    */   extends Property
/*    */ {
/*    */   private PropAdder adder;
/* 24 */   private boolean allowSorting = true;
/*    */   
/*    */   public VectorProperty(Properties owner, int index, String propName)
/*    */   {
/* 28 */     super(owner, index, propName);
/*    */   }
/*    */   
/*    */   public static Vector<Object> toVector(Object[] arr)
/*    */   {
/* 33 */     Vector<Object> v = new Vector(arr.length);
/* 34 */     for (int i = 0; i < arr.length; i++)
/* 35 */       v.addElement(arr[i]);
/* 36 */     return v;
/*    */   }
/*    */   
/*    */   public static Vector<Object> toVector(Hashtable<String, ?> hash)
/*    */   {
/* 41 */     Vector<Object> v = new Vector(hash.size());
/*    */     
/* 43 */     Enumeration<Object> e = hash.elements();
/* 44 */     while (e.hasMoreElements())
/* 45 */       v.addElement(e.nextElement());
/* 46 */     return v;
/*    */   }
/*    */   
/*    */   public Object delete(Object obj)
/*    */   {
/* 51 */     assert (obj != null);
/* 52 */     assert (this.adder != null);
/* 53 */     return operate(4, obj);
/*    */   }
/*    */   
/*    */   public Object add(Object obj)
/*    */   {
/* 58 */     assert (obj != null);
/* 59 */     assert (this.adder != null);
/* 60 */     return operate(3, obj);
/*    */   }
/*    */   
/*    */   public boolean addTest(Object obj)
/*    */   {
/* 65 */     assert (obj != null);
/* 66 */     assert (this.adder != null);
/* 67 */     return operate(5, obj) != null;
/*    */   }
/*    */   
/*    */   public VectorProperty setAdder(PropAdder adder)
/*    */   {
/* 72 */     this.adder = adder;
/* 73 */     return this;
/*    */   }
/*    */   
/*    */   public PropAdder getAdder()
/*    */   {
/* 78 */     return this.adder;
/*    */   }
/*    */   
/*    */   public void allowSorting(boolean allow)
/*    */   {
/* 83 */     this.allowSorting = allow;
/*    */   }
/*    */   
/*    */   public boolean shouldSort()
/*    */   {
/* 88 */     return this.allowSorting;
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\VectorProperty.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */