1
+ package com .oracle .graal .python .runtime .sequence .storage ;
2
+
3
+ import com .oracle .graal .python .builtins .objects .range .PRange ;
4
+
5
+ public class RangeSequenceStorage extends SequenceStorage {
6
+
7
+ private final PRange range ;
8
+
9
+ public RangeSequenceStorage (PRange range ) {
10
+ this .range = range ;
11
+ }
12
+
13
+ public PRange getRange () {
14
+ return range ;
15
+ }
16
+
17
+ @ Override
18
+ public int length () {
19
+ return range .len ();
20
+ }
21
+
22
+ @ Override
23
+ public void setNewLength (int length ) {
24
+ throw new UnsupportedOperationException ();
25
+ }
26
+
27
+ @ Override
28
+ public SequenceStorage copy () {
29
+ return this ;
30
+ }
31
+
32
+ @ Override
33
+ public SequenceStorage createEmpty (int newCapacity ) {
34
+ throw new UnsupportedOperationException ();
35
+ }
36
+
37
+ @ Override
38
+ public Object getInternalArrayObject () {
39
+ throw new UnsupportedOperationException ();
40
+ }
41
+
42
+ @ Override
43
+ public ListStorageType getElementType () {
44
+ return ListStorageType .Int ;
45
+ }
46
+
47
+ @ Override
48
+ public Object [] getInternalArray () {
49
+ throw new UnsupportedOperationException ();
50
+ }
51
+
52
+ @ Override
53
+ public Object [] getCopyOfInternalArray () {
54
+ throw new UnsupportedOperationException ();
55
+ }
56
+
57
+ @ Override
58
+ public Object getItemNormalized (int idx ) {
59
+ return range .getItemNormalized (idx );
60
+ }
61
+
62
+ public int getIntItemNormalized (int idx ) {
63
+ return range .getItemNormalized (idx );
64
+ }
65
+
66
+ @ Override
67
+ public void setItemNormalized (int idx , Object value ) throws SequenceStoreException {
68
+ throw new UnsupportedOperationException ();
69
+ }
70
+
71
+ @ Override
72
+ public void insertItem (int idx , Object value ) throws SequenceStoreException {
73
+ throw new UnsupportedOperationException ();
74
+ }
75
+
76
+ @ Override
77
+ public SequenceStorage getSliceInBound (int start , int stop , int step , int length ) {
78
+ throw new UnsupportedOperationException ();
79
+ }
80
+
81
+ @ Override
82
+ public void setSliceInBound (int start , int stop , int step , SequenceStorage sequence ) throws SequenceStoreException {
83
+ throw new UnsupportedOperationException ();
84
+ }
85
+
86
+ @ Override
87
+ public void delSlice (int start , int stop , int step ) {
88
+ throw new UnsupportedOperationException ();
89
+ }
90
+
91
+ @ Override
92
+ public void delItemInBound (int idx ) {
93
+ throw new UnsupportedOperationException ();
94
+ }
95
+
96
+ @ Override
97
+ public Object popInBound (int idx ) {
98
+ throw new UnsupportedOperationException ();
99
+ }
100
+
101
+ @ Override
102
+ public int index (Object value ) {
103
+ throw new UnsupportedOperationException ();
104
+ }
105
+
106
+ @ Override
107
+ public void append (Object value ) throws SequenceStoreException {
108
+ throw new UnsupportedOperationException ();
109
+ }
110
+
111
+ @ Override
112
+ public void extend (SequenceStorage other ) throws SequenceStoreException , ArithmeticException {
113
+ throw new UnsupportedOperationException ();
114
+ }
115
+
116
+ @ Override
117
+ public void reverse () {
118
+ throw new UnsupportedOperationException ();
119
+ }
120
+
121
+ @ Override
122
+ public void sort () {
123
+ throw new UnsupportedOperationException ();
124
+ }
125
+
126
+ @ Override
127
+ public boolean equals (SequenceStorage other ) {
128
+ if (other instanceof RangeSequenceStorage ) {
129
+ return range .equals (((RangeSequenceStorage ) other ).range );
130
+ }
131
+ return false ;
132
+ }
133
+
134
+ @ Override
135
+ public SequenceStorage generalizeFor (Object value , SequenceStorage other ) {
136
+ throw new UnsupportedOperationException ();
137
+ }
138
+
139
+ @ Override
140
+ public Object getIndicativeValue () {
141
+ return range .getStart ();
142
+ }
143
+
144
+ @ Override
145
+ public void ensureCapacity (int newCapacity ) {
146
+ throw new UnsupportedOperationException ();
147
+ }
148
+
149
+ @ Override
150
+ public void copyItem (int idxTo , int idxFrom ) {
151
+ throw new UnsupportedOperationException ();
152
+ }
153
+
154
+ }
0 commit comments