Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  object.gi   Sprache: Shell

 

#############################################################################
##
##  This file is part of GAP, a system for computational discrete algebra.
##  This file's authors include Martin Schönert.
##
##  Copyright of GAP belongs to its developers, whose names are too numerous
##  to list here. Please refer to the COPYRIGHT file for details.
##
##  SPDX-License-Identifier: GPL-2.0-or-later
##
##  This file contains some methods applicable to objects in general.
##


#############################################################################
##
#M  '<obj1> = <obj2>' . . . . . . . . . . . for objects in different families
##
InstallMethod( \=,
    "for two objects in different families",
    IsNotIdenticalObj,
    [ IsObject,
      IsObject ],
    0,
    false );


#############################################################################
##
#M  \=( <fam1>, <fam2> )  . . . . . . . . . . . . . . . . .  for two families
##
InstallMethod( \=,
     "for two families: delegate to `IsIdenticalObj'",
     true,
     [ IsFamily, IsFamily], 0,
     IS_IDENTICAL_OBJ );


#############################################################################
##
#M  \<( <obj1>, <obj2> )  . . . . . . . for two objects in different families
##
##  <#GAPDoc Label="[1]{object.gi}">
##  Only for the following kinds of objects, an ordering via <C><</C> of objects
##  in <E>different</E> families (see <Ref Sect="Families"/>) is supported.
##  Rationals (see <Ref Filt="IsRat"/>) are smallest,
##  next are cyclotomics (see <Ref Filt="IsCyclotomic"/>),
##  followed by finite field elements (see <Ref Filt="IsFFE"/>);
##  finite field elements in different characteristics are compared
##  via their characteristics,
##  next are permutations (see <Ref Filt="IsPerm"/>),
##  followed by the boolean values <K>true</K>, <K>false</K>, and <K>fail</K>
##  (see <Ref Filt="IsBool"/>),
##  characters (such as <C>{</C>}a{'}', see <Ref Filt="IsChar"/>),
##  and lists (see <Ref Filt="IsList"/>) are largest;
##  note that two lists can be compared with <C><</C> if and only if their
##  elements are again objects that can be compared with <C><</C>.
##  <P/>
##  For other objects, &GAP; does <E>not</E> provide an ordering via <C><</C>.
##  The reason for this is that a total ordering of all &GAP; objects
##  would be hard to maintain when new kinds of objects are introduced,
##  and such a total ordering is hardly used in its full generality.

##  However, for objects in the filters listed above, the ordering via <C><</C>
##  has turned out to be useful.
##  For example, one can form <E>sorted lists</E> containing integers and nested
##  lists of integers, and then search in them using <C>PositionSorted</C>
##  (see <Ref Sect="Finding Positions in Lists"/>).
##  <P/>
##  Of course it would in principle be possible to define an ordering
##  via <C><</C> also for certain other objects,
##  by installing appropriate methods for the operation <C>\<</C>.
##  But this may lead to problems at least as soon as one loads &GAP; code
##  in which the same is done, under the assumption that one is completely
##  free to define an ordering via <C><</C> for other objects than the ones
##  for which the <Q>official</Q> &GAP; provides already an ordering via <C><</C>.
##  <#/GAPDoc>
##
function##  (see <Ref Filt="IsBool"/>),
    local TO_COMPARE, i, j##  and lists (see <Ref Filt="IsList"/>) are largest;

    TO_COMPARE := [
    [ IsCyclotomic, "##  elements are again objects that can be compared with <C><##  <P/>
    [ IsFFE,##  The reason for this is that a total ordering of all &GAP; objects##  would be hard to maintain when new kinds of objects are introduced,
    [ IsPerm,       ##  has turned out to be useful.
    [ IsBool,       "boolean" ]##  lists of integers, and then search in them using <C>PositionSorted</C>
    [ IsChar,       "character" ##  via <C><</C> also for certain other objects,
    [ IsList,       "list" ],
                                              ];
    for i in [ 1 .. Length( TO_COMPARE ) ] do##  free to define an ordering via <C><</C> for other objects than the ones
      for j in [ 1 .. Length(##  <#/GAPDoc>
        if    local TO_COMPARE i j,func 
if  then=  : ;fijava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
          infostr:= "for a ";
          APPEND_LIST_INTR( infostr, TO_COMPARE[i][2] );
          APPEND_LIST_INTR( infostr, ", and a " );
APPEND_LIST_INTR infostr, TO_COMPARE[j][2] );
          InstallMethod( \<, infostr, true,
              [ TO_COMPARE[i][1], TO_COMPARE[j][1] ], 0, func );
        fi;
      od;
       ];
end();

InstallMethod( \<,
    "forfori [1 .Length()]
    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

    function( z1="  ;
returnCharacteristic   ;
    end );

InstallMethod(infostr,[j[])
    "for two small lists, possiblyInstallMethod( \<, infostr, true,
    true,
    [ IsList and IsSmallList,                TO_COMPARE[]1, TO_COMPARE[]]] ,func)
    od

 java.lang.StringIndexOutOfBoundsException: Range [44, 33) out of bounds for length 60

    local len, i;

    # We ask for being small in order to catch the default methods
    
    IsSmallListlist1)and IsSmallList(list2 )then
      return LT_LIST_LIST_DEFAULT( list1, list2 );
    else

      len return Characteristic)<Characteristic(z2)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
      i: 1
      while i <= len do
        list1[]<list2[i] 
          return true;
        elif list2[i    LT_LIST_LIST_DEFAULT;
                 return false;
        ;
        i:= i+1;
      od;
      return <Length(list2)

    fi;
end );

InstallMethod(\,
    "for two finite  )and IsSmallList(list2 )then
    true,
    [ IsList, IsList ], 0,
    LT_LIST_LIST_FINITE );

#############################################################################
##
#M  String( <obj> ) . . . . . . . . . . . . default String method for objects
##
##
String]- object"

#############################################################################
##
#M  PrintObj( <obj> ) . . . . . . . . . . . default Print method for objects
##
##
          java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 23
 IsObject, functiono)Print(rintString(); end)

#############################################################################
##
#M  PrintString( <obj> ) . . . . . . . . . . . . default delegating to String
##
##
InstallMethod    LT_LIST_LIST_FINITE
  [IsObject

# this command is useful to construct strings made of objects. It calls
# PrintString to its arguments and concatenates them. It is used in the
# library, but is not meant to be documented. (LB)
#
BIND_GLOBAL("STRINGIFY", function(arg)
    InstallMethod(tring [sObject] o- <object>";
    s := ShallowCopy(String(arg[1]));
    for i in [2..Length(arg)] do
        java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 2
    od
    return s;
end);

BIND_GLOBAL("PRINT_STRINGIFYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    local s##
    s = ShallowCopy(rintString(rg[]);
     [IsObject,-1 String;
        Append(s,"\>");
        Append(s,PrintString# PrintString to its arguments and concatenates them. It# library, but is not meant to be documented#
       Appends,"<)
    od;
    s ;
end);

#############################################################################
##
#F  StripLineBreakCharacters( <string> ) . . . removes \< and \> characters
##
InstallGlobalFunctionAppendsStringargi)
  st)
    local res return java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    ress:ShallowCopy((arg[1])java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    for c in st do
        if c <> '\<' and c <> '\>' then
            Add(res,c);
fi
    od;
            Append(s,"\;
    return res;
  end;

#############################################################################
##
#M  PrintString( <obj>, <width> )  . . . . . convert object into a string
##
#F  StripLineBreakCharacters( <string> ) . . . java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 2
    " an    "
    true res: (st)
    [,
      IsPosInt ],
    0,

function( str, n )

    local   blanks, fill;

    str:= PrintString( str );

    # If <width> is too small, return.
 ) java.lang.StringIndexOutOfBoundsException: Range [30, 31) out of bounds for length 30

    #############################################################################

#M  PrintString( <obj>, <width> )  . . . . . convert##
    blanks:= "                                                ";
    fill := n - Length( str );
    while fill > 0  do
        if fill >= Length    "for an object,and a positive  integer",
            str := Concatenation( blankstrue,
        else
=({  . ] ,str;
        fi;
        fill := n - Length(      IsPosInt ]
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    return str;
end );


InstallMethodjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    "for an object, and a negative integer",
    true,
    [ IsObject,
          : n-Length(str)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    ,

     str: Concatenation blanks, str )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48

    local   blanks, fill;

    str:= PrintString( str );

    # If <width> is too small, return.
if( str  >= -n java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        return str
    fi;nd ;

    # If <width> is negative, blanks are filled in from the right.
    blanks := "                                                 ";
    fill :=  - n - Length( str );
    while"or an object,and a negative integer",
        if      IsObject
str = Concatenation( str,blanks );
        else
            str := Concatenation( str, blanks{ [ 1 .. fill ] } );
        
(str  java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    od;
    java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
end r str;


InstallMethod( PrintString,
    "for an    ;
    true,
    [ IsObject,
      IsZeroCyc ],    # If <width> is negative, blanks are filled in from the right.
    0

function(str zero )
    return     while fill >do
end)


#############################################################################
##
#M  String( <obj>, <width> )  . . . . . convert object into a string
##
InstallMethod( String,
    "for an java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 11
    true,
    [ IsObject,
IsPosInt ],
    0,

function( str, n )

    local   blanks, fill;

    str:= String

   # If <width> is too small, return.
    if Length( str ) >= java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return (str);
    fi;

    # If <width> is positive, blanks are filled in from the left.
    blanks :     java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    PrintString )
    while>0  do
        if fill
            #############################################################################
        else
            str := Concatenation( blanks{ [ 1 .. fill ] }, str );
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 11
        ( str);
    od;
    java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 9
end );


InstallMethod( String,
    "for an object, and a    0,
    true,
    [ IsObject,
      IsNegRat  )
    0,

function( str, n )

local java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

    str:= String( str );

        (tr)
        java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
        return ShallowCopy(str);
   fi

 <width> negative,blanks are filled in from the right.
    blanks := "                                                 ";
    fill :=  - n - Length( str );
    whilefill > 0do
        if fill >= Length(            str : Concatenation blanks,str );
            str := Concatenation( str, blanks );
        else
            str := Concatenation(            str:=Concatenation( blanks{ [ 1 .. fill ] }, str );
        fi;
        fill :=  - n - Length( str        ;
    od;
    return str;
end );


InstallMethod String,
    "for an object, and zero",
    true    return str;
    [ IsObject,
      IsZeroCyc ],
    0,

function( str, zero )
    return ShallowCopy(String( str )
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0


#############################################################################
##
#M  PrintObj( <obj> )
##
InstallMethod( PrintObj
or an object with name"java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    true,
    [ HasName ],
    SUM_FLAGS, # override anything specific
    function    localblanks, fill;


#############################################################################
##
#M  ViewObj( <obj> )  . . . . . . . . . . . . . . . . for an object with name
##
InstallMethod( ViewObj,
    #
    true,
[HasName]
    SUM_FLAGS, # override anything specificreturnShallowCopy(tr)
        function>negative  arefilledin   .


#############################################################################
##
#V  DEFAULTVIEWSTRING . . . . . . . . . default string returned by ViewString
##
BIND_GLOBAL  >0do


#############################################################################
##
#M  ViewObj( <obj> )  . . . . . try view string before delegating to PrintObj
##
InstallMethod( ViewObj,
    "default method trying java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 12
    true        ;
        =-  )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    1, InstallMethod Stringjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    function ( obj )
      local st;
      st :     IsObjectjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
      if not(IsIdenticalObjst,EFAULTVIEWSTRING) then
          function(str,zero )
      else
          TryNextMethod();
      fi;
    end );


#############################################################################
##
#M  ViewString( <obj> ) . . . . . . . . . . . . . . . for an object with name
##
InstallMethod##
               [ HasName ], ##
               Name )java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22


#############################################################################
##
#M  ViewString( <obj> ) . . . . . . . . . . . . . . . . . . . default method
##
InstallMethod( ViewString, "generic default method", true,
[IsObject ],  
                                   # in the resclasses package
  functionobj
    return
  #############################################################################


#############################################################################
##
#M  ShallowCopy( <obj> )  . . . . . . . . . . . . . . . shallow copy of <obj>
##
InstallMethod 
    "for a (not copyable) objectfunction  obj   (Name( obj ));end)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
    true,
    [ IsObject ],
    0,

function##
    ifIsCopyableobj)  
        TryNextMethod
    else
        return obj##
    fi;
end );


#############################################################################
##
#M  IsInternallyConsistent( <obj> ) . . . . . . . default method 'ReturnTrue'
##
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 9
"method ReturnTrue'java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
true
    [        notIsIdenticalObjst,DEFAULTVIEWSTRING) 
    ReturnTrue );


#############################################################################
##
#M  KnownAttributesOfObject( <object> ) . . . . . list of names of attributes
##
InstallMethod( java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 10
    "for an object#M  ViewString( <obj> ) . . . . . . . . . . . . . . . for an object with name
    true
    [ IsObject ],
    0,

function( obj )
               Name )

    # get the flags list#############################################################################
    type  := TypeObj(obj);
    trues := TRUES_FLAGS ,"defaultmethod,true,

    # filter the representations
    atomic readonly FILTER_REGION do                                   # in the resclasses package
     DEFAULTVIEWSTRING;
    ;

    # convert it into names, removing the "Has" prefix"
    ##
end );


#############################################################################
##
#M  KnownPropertiesOfObject( <object> ) . . . . . list of names of properties
##
InstallMethod([IsObject ,
    for anobject,
    true,
    [function(obj java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    0,fijava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

function( obj )
    

    # get the flags list
    type  := InstallMethod( IsInt,
    "efault method ReturnTrue'java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

    # filter the representations ;

        trues := Filtered( ##
    od;

   # convert it into names, removing the "Has" prefix"
    return List( truejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
end );


#############################################################################
##
#M  KnownPropertiesOfObject( <object> ) . . . . . list of names of properties
#M  KnownTruePropertiesOfObject( <object> )  list of names of true properties
##
InstallMethod( java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 7
         List(NamesFilter(rues) x - x{[.Length(x] )
    true
    [ IsObject ],
    0,

#M  KnownPropertiesOfObject( <object> ) . . . . .##
    local   type,  truesfor object"

    # get the flags list0java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    type  := TypeObj(java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 24
     :=(type!2]);

    # filter the representations
    atomic readonly  do
        ( trues x >#M  KnownPropertiesOfObject( <object> ) . . . . . list of names of properties#M  KnownTruePropertiesOfObject( <object> )  list of names of true properties
    ;

    # convert it into names
        [IsObject,
end );


#############################################################################
##
#M  CategoriesOfObject( <object> )  . . . . . . . list of names of categories
##
InstallMethod(    : (ype[2);
    "for     # filte
true,
Object]
     java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
    local   type,  trues;

    # get the flags list
    type  := TypeObj(##
   trues: TRUES_FLAGS(ype!2])

    # filter the representations
    atomic readonly java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 9
        truesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    od;

    # convert it into names
   return NamesFiltertrues)



#############################################################################
##
#M  RepresentationsOfObject( <object> ) . .  list of names of representations
##
end ;

    true,
    [ IsObject ],
    0,

function##
    local   type,  trues;

    # get the flags list
    type  : TypeObjobj)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
     ]java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17

    # filter the representations
    localtype truesjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
            type  : (bj)
    od;

    # convert it into names
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 30
end );


#############################################################################
##
#V  DEFAULTDISPLAYSTRING . . . . . . default string returned by DisplayString
##
BIND_GLOBALNamesFilter(rues)


#############################################################################
##
#M  Display( <obj> )  . . . . . . . . . . . . . . . . . . . display an object
##
##  We do not call `PrintObj' because strings shall be displayed without
##  enclosing doublequotes.
##
InstallMethod( Display,
        "generic: use DisplayString or otherwise PrintObj",
        true,
        [ ##  enclosing doublequotes.
  (obj)
    local st;
    st := DisplayString(obj);
    ifIsIdenticalObjstDEFAULTDISPLAYSTRING 
        Printtrue,
            ,0,
        Print(t)
;
end     if IsIdenticalObj(t,EFAULTDISPLAYSTRING 


#############################################################################
##
#M  DisplayString( <obj> )  . . . . . . . . . . display string for an object
##
##  We do not call `PrintObj' because strings shall be displayed without
##  enclosing doublequotes.
##
InstallMethod( ##  We do not call `PrintObj' because strings shall be displayed without
        "generic: ##  enclosing doublequotes.
        ,
[IsObject] -,
  function obj )
    return DEFAULTDISPLAYSTRING;
  end );

#############################################################################
##
#M  PostMakeImmutable( <obj> ) . . . . . . . . . . . . .do nothing in general
##

java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 2
        "java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
        true
        [java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 13
        function( obj)
    return;
java.lang.StringIndexOutOfBoundsException: Range [5, 3) out of bounds for length 6

#############################################################################
##
#M  SetName( <obj>,<name> )
##
##  generic routine to test 2nd argument
##
InstallMethod(SetName,"eneric test routine" true,[IsObject, ]
  # override setter
  SUM_FLAGS+1java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
function obj,)
  if not IsString(str) then
    ("etName n>must be a string);
  fi;
  TryNextMethod();
end ;

#############################################################################
##
#V  TYPE_KERNEL_OBJECT
##
##
##
##  TYPE_KERNEL_OBJECT is the type of data objects used internally in the
##  kernel which have no significant &GAP; callable methods and should not
##  normally be seen at &GAP; level. These are typically lookup tables or
##  buffers created and used within the kernel and containing binary data only
##

DeclareRepresentation("IsKernelDataObjectRep",IsDataObjectRep )

BIND_GLOBAL("YPE_KERNEL_OBJECT",
          NewType(ewFamily(KernelObjectFamily"IsObject  )java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
          

InstallMethod(String,[sKernelDataObjectRep],o->akeImmutable(kernel object>);

Messung V0.5 in Prozent
C=84 H=80 G=81

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.9Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1128594
#Domains=1976912