AbstractMultidimensionalArray.st
author Stefan Vogel <sv@exept.de>
Thu, 16 Apr 2020 16:57:05 +0200
changeset 25362 f1606835f9fb
parent 25119 1dbc4341b4c0
permissions -rw-r--r--
#TUNING by stefan class: Win32OperatingSystem class changed: #getProcessId cache my own process id
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25119
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     1
"
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     2
 COPYRIGHT (c) 2018 by eXept Software AG
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     3
              All Rights Reserved
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     4
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     5
 This software is furnished under a license and may be used
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     6
 only in accordance with the terms of that license and with the
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     7
 inclusion of the above copyright notice.  This software may not
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     8
 be provided or otherwise made available to, or used by, any
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
     9
 other person.  No title to or ownership of the software is
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    10
 hereby transferred.
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    11
"
24574
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ NameSpace: Smalltalk }"
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
SequenceableCollection variableSubclass:#AbstractMultidimensionalArray
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Collections-MultiDimensional'
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
25119
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    23
!AbstractMultidimensionalArray class methodsFor:'documentation'!
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    24
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    25
copyright
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    26
"
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    27
 COPYRIGHT (c) 2018 by eXept Software AG
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    28
              All Rights Reserved
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    29
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    30
 This software is furnished under a license and may be used
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    31
 only in accordance with the terms of that license and with the
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    32
 inclusion of the above copyright notice.  This software may not
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    33
 be provided or otherwise made available to, or used by, any
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    34
 other person.  No title to or ownership of the software is
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    35
 hereby transferred.
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    36
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    37
"
1dbc4341b4c0 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 24675
diff changeset
    38
! !
24574
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
24675
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    40
!AbstractMultidimensionalArray class methodsFor:'queries'!
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    41
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    42
isAbstract
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    43
    "Return if this class is an abstract class.
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    44
     True is returned here for myself only; false for subclasses.
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    45
     Abstract subclasses must redefine this again."
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    46
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    47
    ^ self == AbstractMultidimensionalArray.
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    48
! !
4826b24634fa #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 24591
diff changeset
    49
24591
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    50
!AbstractMultidimensionalArray methodsFor:'accessing'!
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    51
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    52
dimensions
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    53
    self subclassResponsibility
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    54
! !
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    55
24574
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!AbstractMultidimensionalArray methodsFor:'error handling'!
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
dimensionError
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    self error:'number of dimensions vs. number of given indices'
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
! !
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
24591
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    62
!AbstractMultidimensionalArray methodsFor:'queries'!
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    63
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    64
isSquare
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    65
    |dims|
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    66
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    67
    dims := self dimensions.
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    68
    ^ dims size == 2
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    69
    and:[(dims at:1) == (dims at:2)]
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    70
! !
2efa5f69125c #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 24574
diff changeset
    71
24574
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!AbstractMultidimensionalArray class methodsFor:'documentation'!
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
version_CVS
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
    ^ '$Header$'
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
! !
da29ade15da2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77