What is Abstract Data type ?

Shall i call a class to be an Abstract data type ?

jverd wrote:
I do not agree. For one thing, I'd consider classes realizations or implementations of ADTs. That nitpick aside, however, the easiest counterexample is a class with no member variables. The "D" of "ADT" is missing there. I wouldn't consder java.lang.Math and ADT, just a collection of functions and constants.I wouldn't say being implemented in a specific language takes anything away from an ADT. An implemented ADT is also an ADT.
Being an ADT doesn't require the existence of state. This was what you meant with "no member variables" right? ADTs can have or not have state.
Your final counterexample concerns so called free functions and constants (static in Java). They should be viewed as part of an ADT definition. But okay, Math itself cannot be considered an ADT so not every class, interface and enum is an ADT as I claimed. Sometimes they're used as namespaces for free functions and constants that have no natural home. Functions and constants associated with primitives have to go somewhere for example. But this usage is atypical.

Similar Messages

  • Abstract data types??

    I am just learning about data structures and am having some difficulty. Can someone please define what an abstract data type means and what it is. A simple example would be great
    Thanks

    The concept of an Abstract Data Type maps nicely to the concept of a Class in Java.

  • HEELLLLP with abstract data types(ie. interfaces)

    Hello Java World,
    I have a few questions regarding abstract data types(ADT) such as interfaces, etc.
    1. Which of the following is allowed in Java ?
    interface TA extends student, Employee
    class teachAssist implements TA, Cloneable, Sortable{..}
    2. ADTs cannot be instantiated only extended/implemented(coded)??
    3. Can a interface implements/extend classe(s)?
    4. Why is a Vector not an ADT? Is it because it contains implementations for its some of its methods?
    Thanks for the help, in advance!!
    RahimS

    Hello Java World,
    I have a few questions regarding abstract data
    types(ADT) such as interfaces, etc.
    1. Which of the following is allowed in Java ?
    interface TA extends student, Employee
    {...}Allowed (if student and Employee are also Interfaces).
    class teachAssist implements TA, Cloneable,
    Sortable{..}Allowed.
    >
    2. ADTs cannot be instantiated only
    extended/implemented(coded)??True.
    3. Can a interface implements/extend classe(s)?No. An interface simply defines a skeleton...says what methods are present in classes that implement it...therefore an interface cannot 'implement' anything. It may however extend other Interfaces.
    4. Why is a Vector not an ADT? Is it because it
    contains implementations for its some of its methods?A Vector is not an ADT because it is fully implemented (it contains implementations for ALL of its methods).
    >
    >
    Thanks for the help, in advance!!
    RahimS

  • Abstract data types - index List

    Hi,
    What does it mean 'Index List' abstract data type? I've searched on Google and can't find any reference to the term 'Index List'.
    Does anybody know any examples of distinct classes for this data type?
    Any help really appreciated.
    Thanks

    Hi,
    What does it mean 'Index List' abstract data type? I've searched on Google and can't find any reference to the term 'Index List'.
    Does anybody know any examples of distinct classes for this data type?
    Any help really appreciated.
    Thanks

  • New Effective CAL essay: How do I create an abstract data type in CAL?

      <p><strong>How do I create an abstract data type in CAL?</strong></p>  <p> </p>  <p>An <em>abstract data type</em> is one whose internal representation can be changed without needing to modify the source code of client modules that make use of that type. For software maintainability, it is a good idea to make a type that is subject to change or enhancement into an abstract data type. Another reason to create an abstract data type is to enforce invariants for values of the type that can only be ensured by using <em>constructor functions</em> (i.e. functions that return values of that type).</p>  <p> </p>  <p>In principle it is simple to create an abstract data type in CAL. For an algebraic data type, make the type constructor public and all data constructors private. For a foreign data type, make the type constructor public and the implementation scope private. If a scope qualifier is omitted, the scope is taken to be private.</p>  <p> </p>  <p>For example, the Map algebraic data type has the public type constructor Map and the data constructors Tip and Bin are each private, so it is an abstract data type.</p>  <p> </p>  <p>/** A map from keys (of type {@code k@}) to values</p>  <p>   (of type {@code a@}). */</p>  <p><strong>data</strong> <strong>public</strong> Map k a <strong>=</strong></p>  <p>    <strong>private</strong> Tip <strong>|</strong></p>  <p>    <strong>private</strong> Bin</p>  <p>        size      <strong>::</strong> <strong>!</strong>Int</p>  <p>        key       <strong>::</strong> <strong>!</strong>k</p>  <p>        value     <strong>::</strong> a</p>  <p>        leftMap   <strong>::</strong> <strong>!(</strong>Map k a<strong>)</strong></p>  <p>        rightMap  <strong>::</strong> <strong>!(</strong>Map k a<strong>);</strong></p>  <p><strong> </strong></p>  <p><strong> </strong></p>  <p>There are a number of invariants of this type: the size field represents the number of elements in the map represented by its Bin value. The keys in leftMap are all less than key, which in turn is less than all the keys in rightMap.  In particular, non-empty Map values can only be created if the key parameter type is a member of the Ord type class.</p>  <p> </p>  <p>Values of the Map type can be created outside the Cal.Collections.Map module only by using constructor functions such as insert:</p>  <p> </p>  <p>insert <strong>::</strong> Ord k <strong>=></strong> k <strong>-></strong> a <strong>-></strong> Map k a <strong>-></strong> Map k a<strong>;</strong></p>  <p><strong>public</strong> insert <strong>!</strong>key value <strong>!</strong>map <strong>= ...</strong></p>  <p> </p>  <p>The owner of the Cal.Collections.Map module must ensure that all invariants of the Map type are satisfied, but if this is done, then it will automatically hold for clients using this function.</p>  <p> </p>  <p>Some examples of foreign abstract data types are Color, StringNoCase  and RelativeDate:</p>  <p> </p>  <p><strong>data</strong> <strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> <strong>private</strong> "java.awt.Color"</p>  <p>    <strong>public</strong> Color<strong>;</strong></p>  <p><strong> </strong></p>  <p><strong>data</strong> <strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> <strong>private</strong> "java.lang.String"</p>  <p>    <strong>public</strong> StringNoCase<strong>;</strong></p>  <p><strong> </strong></p>  <p><strong>data</strong> <strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> <strong>private</strong> "int"</p>  <p>    <strong>public</strong> RelativeDate<strong>;</strong></p>  <p> </p>  <p>The private implementation scope for Color means that a foreign function whose type involves Color can only be declared in the Cal.Graphics.Color module where the Color type is defined. A foreign function declaration involving the Color type relies on the compiler knowing that the Color type corresponds to java.awt.Color to resolve the corresponding Java entity i.e. it must know about the implementation of the Color type. Having a private implementation scope means that the Color type can be changed to correspond to a different Java class, or indeed to be an algebraic type, without the risk of breaking client code.</p>  <p> </p>  <p>In all these three cases there are useful, and different, design reasons to adopt a private implementation scope:</p>  <p> </p>  <p>For RelativeDate, the Java implementation type int represents a coded Gregorian date value in the date scheme used by Crystal Reports. Not all int values correspond to valid dates, and the algorithm to map an int to a year/month/day equivalent is fairly complicated, taking into account things like Gregorian calendar reform. Thus, it is desirable to hide the implementation of this type.</p>  <p> </p>  <p>For StringNoCase, the implementation is more straightforward as a java.lang.String. The reason to adopt a private implementation scope is to ensure that all functions involving StringNoCase preserve the semantics of StringNoCase as representing a case-insensitive string value. Otherwise it is very easy for clients to declare a function such as:</p>  <p> </p>  <p><strong>foreign</strong> <strong>unsafe</strong> <strong>import</strong> <strong>jvm</strong> "method replace"</p>  <p>    replaceChar <strong>::</strong> StringNoCase <strong>-></strong> Char <strong>-></strong> Char <strong>-></strong> StringNoCase<strong>;</strong></p>  <p> </p>  <p>which does not handle case-insensitivity correctly, but is a perfectly valid declaration. This declaration results in a compilation error when it is placed outside the module in which StringNoCase is defined because of the private implementation scope of StringNoCase.</p>  <p> </p>  <p>For Color, the issue is somewhat more subtle. The java.awt.Color implementation type is semantically the same as the CAL Color type. The problem is that java.awt.Color is mutable (since it can be sub-classed to create a mutable type). It is preferable for a first-class CAL type to not be mutable, so we simply make the implementation scope private to ensure that this will be the case. </p>  <p> </p>  <p>A somewhat less encapsulated kind of abstract data type can be created using <em>friend modules </em>and <em>protected</em> scope. For example, if an algebraic type is public, and all its data constructors are protected, then the data constructors can be accessed in the friend modules of the module in which the type is defined. Effectively this means that the implementation of the semantics of the type stretches over the module in which the type is defined, and all of its friend modules. These must all be checked if the implementation of the type is modified. </p>  <p> </p>  <p>Given the merits of abstract data types discussed above, it is perhaps surprising that most of the core types defined in the Prelude module are not abstract data types. For example: Boolean, Char, Int, Double, String, List, Maybe, Either, Ordering, JObject, JList, and all record and tuple types are non-abstract types. </p>  <p> </p>  <p>There are different reasons for this, depending on the particular type involved. </p>  <p> </p>  <p>For example, Boolean, List, Maybe, Either and Ordering are all rather canonical algebraic data types with a long history in functional languages, with many standard functions using them. They are thus guaranteed never to change. In addition, their values have no particular design invariants that need to be enforced via constructor functions. Exposing the data constructors gives clients some additional syntactic flexibility in using values of the type. For example, they can pattern match on the values using case expressions or let patterns.</p>  <p> </p>  <p>Essentially the same explanation holds for record and tuple types. Although non-tuple record types are less canonical, they do correspond to the fundamental notion of an anonymous named-field product type. The "anonymous" here simply means that the programmer can create an entirely new record type simply by creating a value; the type does not have to be declared anywhere prior to use.</p>  <p> </p>  <p>Char, Int, Double, String, JObject and JList are foreign types where in fact part of the semantics of the type is that we want clients to know that the type is a foreign type. For example, we want clients to know that Prelude.Int is essentially the Java primitive unboxed int type, and has all the semantics you would expect of the Java int type i.e. this is quite different from RelativeDate which is using int as its implementation type in a very tactical way that we may choose to change. One can think of a public foreign type declaration with public implementation scope as simply introducing the Java type into the CAL namespace.</p>  <p> </p>  <p>One interesting point here is with CAL&#39;s naming convention for public foreign types. We prefix a type name by "J" (for "Java") for foreign types with public implementation type such that the underlying Java type is mutable. This is intended as mnemonic that the type is not a pure functional type and thus some caution needs to be taken when using it. For example, Prelude.JObject has public Java implementation type java.lang.Object.</p>  <p> </p>  <p>In the case where the underlying Java type is not mutable, we do not use the prefix, since even though the type is foreign; it is basically a first class functional type and can be freely used without concern. For example, Prelude.String has public Java implementation type java.lang.String.</p>  <p> </p>  <p>In the case where the implementation type is private, then the fact that the type is a foreign type, whether mutable or not, is an implementation detail and we do not hint at that detail via the name. Thus Color.Color has as its private Java implementation type the mutable Java type java.awt.Color. </p>  <p> </p>  <p>When creating abstract data types it is important to not inadvertently supply public API functions that conflict with the desired public semantics of the type. For example, if the type is publicly a pure-functional (i.e. immutable) type such as Color, it is important not to expose functions that mutate the internal Java representation.</p>  <p> </p>  <p>A more subtle case of inadvertently exposing the implementation of a type can occur with derived instances. For example, deriving the Prelude.Outputable and Prelude.Inputable type classes on a foreign type, whose implementation type is a mutable Java reference type, allows the client to gain access to the underlying Java value and mutate it
    (by calling Prelude.output, mutating, and then calling Prelude.input). The solution in this case is to not derive Inputable and Outputable instances, but rather to define a custom Inputable and Outputable instance that copies the underlying values.</p>

    Hi Pandra801,
    When you create a the external content type, please try to add a filter based on your select statement.
    http://arsalkhatri.wordpress.com/2012/01/07/external-list-with-bcs-search-filters-finders/
    Or, try to create a stored procedure based on your select statement, then create ECT using the SQL stored procedure.
    A step by step guide in designing BCS entities by using a SQL stored procedure
    http://blogs.msdn.com/b/sharepointdev/archive/2011/02/10/173-a-step-by-step-guide-in-designing-bcs-entities-by-using-a-sql-stored-procedure.aspx
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • What is "g" data type? Is it STRING?

    Hi Experts,
    Simple and basic doubt,.....
    What is "g" data type? Is it STRING?
    Like these, when I get in future for others, Where Can I see them, I tried in SE11, and F4, but did not figure it out!!
    thanq

    thanq
    my other thread:
    This is production issue.
    I have given menu>extras->ONLY ONE serial #s to the item of 10 of quantity 3/material in the out bound delivery.
    Then, pressed the PGI. worked fine.
    In next, in another case, I created another delivery for the same material, of the qunatity is 3, but different serial #s,-.....assigned 2 different serial #s.
    then, am getting DUMP.
    from ST22 the Dump is,
    In the FM of CHECK_STRING_SUCCESSOR of with in "PROCESS_STRINGS_FOR_PRINT" .
    The reason for the exception is:
    You attempted to pass the field "I_SPECIAL_CHARS" to the formal parameter
    "I_SPECIAL_CHARS"
    but the formal parameter "I_SPECIAL_CHARS" can accept only fields of
    type "C". The field "I_SPECIAL_CHARS" has the type "g".
    So, let me know that,
    1 - Why its happening ONLY when assigned more than 1 serail #, How to fix it?
    2 - Is there any SAP NOTE??

  • How Abstract class differ, When we call class to be Abstract data type?

    We say as Classes as a realization of Abstract data types, then why should we declare that to be abstract ?
    Hope, the key word Abstract in both ADT and abstract classname mean the same.!!!!

    No, abstract is in the case of "abstract data type" a more general term, whereas in "abstract class" it is a technical term in Java.
    Are you not satisfied with the answers here?
    http://forum.java.sun.com/thread.jspa?threadID=5303930&messageID=10297137#10297137

  • What is the data type for the Data Dashboard XY Graph?

    Hey all,
    I am playing with the new Data Dashboard (!!) on my iPad 2 and am having trouble setting up the shared variables that host data to the XY Graph.
    On my PC, in my Project (inside of a variable library) I have set up shared variables for all of the other controls/indicators available in the app; They all work great. However, I have not been able to identify the data type that is for the XY Graph in Data Dashboard. Of course, inside LabVIEW, I use a cluster of 2 arrays; this is not an available data type that I can select while creating a new variable on the hosting side. I have even gone so far as to create a custom control from my XYGraph in LabVIEW and then creating the data type "From Custom Control..." with no success.
    What gives? Am I missing something obvious? Thanks for the help!!
    Tom
    Solved!
    Go to Solution.

    Great question, Aerogoob.
    The XY graph can be bound to a 1d array of "points", where each point is a cluster of two numerics (X and Y). To create a shared variable of this type, you can set the data type to "From Custom Control..." in the shared variable properties dialog. Of course, first you'll have to build the custom control of the correct type: array of cluster of two numerics.
    If any of that doesn't make sense, please post back and we can walk you through it in more detail.
    Also, just for completeness, the chart indicator can be bound to a scalar numeric or to an array of numerics. The graph indicator can only be bound to an array of numerics.

  • What's the data type when defining a KF to show an integer with a sign?

    We want show some days difference which should be an integer with either a positive or negative sign.  I used to design a KF with type of Number with "DEC - Counter or amount field with comma and sign" as the Data Type, but find it shows 25.000 if the day difference is 25 days.  We want to show it as 25 other than 25.000.  Then what type would we pick when defining the KF?  Use Integer as the type?  But we also want it to show the sign symbol.
    The type field is dimmed as long as the InfoObj. is activated that I have to remove this field.  I've delete all the data loaded in ODS, PSA and etc., and I have successfully remove this KF from InfoSource, but when I try to remove it from the ODS, always get the msg "Can't move/delete locked InfoObjects" even if the InfoObject is not locked (I've tried SM12 to delete all locked entries and also tried relog on, but not helpful).  If someone gives any idea, I would be very appreciated on how to remove this KF from ODS and also let me what type should I use when creating a new KF which only shows integer with a sign!
    Thanks

    hey Siggi,
    Now after I right click the ODS and select "Delete Data", the KF eventually gets removed from the ODS without any error, then I continue to delete this InfoObj. 
    However, when I run the InfoPackage to load data to the ODS, get a msg (see below in between two dashed lines):
    Syntax error in GP_ERR_RSDRO_UPDATE, row 1,210 (-> long text)
    Message no. RG102
    Diagnosis
    The data object "I_S_OLDDATA" does not have a component called "/BIC/Z_field".
    Where Z_field is the InfoObject we deleted.  With this error, that's even worse since that stops any data coming in!  How to get rid of this error that we can continue to load data?
    Thanks

  • What kind of data types in Web Dynpro can be bound to Interactive Form?

    Hello
    Apparently it is not possible to bind a Web Dynpro Context variable of type boolean to a checkbox in an interactive form. We get the PDF Document Render Exception until the data type is changed to string, then the generation seems to work. Does anyone know what data types in Web Dynpro other than String can be bound to an Interactive Form Document? Is there any information about this in help.sap.com/adobeforums.com/elsewhere? I have researched a bit, but couldn't get a general statement on this topic.
    Thank you for your help!
    Kind regards
    Bettina Hepp

    Hi,
    You can Bind the Boolean type of webdynpro to the CheckBox in Adobe Interactive Form.
    Just define the value Attribute in the Context of type Boolean and bind the Checkbox in Aif with this attribute.
    Sample Code:
    if (wdContext.currentContextelement.reason == true)
    ur validations.....
    Regards
    Mustafa

  • What is the data type for time and what to insert

    Hi there
    i had two attributes in a table called start_time and end_time and i want to insert time into these attrbutes e.g 10:00 and 11:00
    How do i do that
    what is oracle's built-in type for time???
    adn how do i insert values in the table(i.e the format)
    thanks

    There is not Oracle type that has just a time. The DATE and TIMESTAMP data types include both the date and the time (TIMESTAMP has millisecond resolution and has optional timezone support). If what you're really interested is a time interval (i.e. 1 hour), there are some INTERVAL data types.
    You have a lot of options for how to specify dates and timestamps along with format masks.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Accessing data from an abstract data type

    I've been trying to find a way to split up a comma in delimited string PL/SQL, and the following article has helped me do that:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:8861471892664
    Basically, the solution calls for creating a simple data type which looks like this:
    create or replace type myTableType as table of
    numberThis will hold the parsed data, which is populated by calling the str2tbl function. But the article doesn't explain how to access the data inside this table once it's been populated.
    For example, I create the type myTableType and the function str2tbl, and run this query:
    SQL> select str2tbl('4,2,3,4') from dual;
    STR2TBL('4,2,3,4')
    MYTABLETYPE(4, 2, 3, 4)The function returns a table of type myTableType, but I have no idea how access or index the data. I want to be able to access the 4, the 2, the 3, or the 4 of the result that is returned in the above example. Here's what I've tried:
    SQL> select temp(1) from (select str2tbl('4,2,3,4') as temp from dual);
    select temp(1) from (select str2tbl('4,2,3,4') as temp from dual)
    ERROR at line 1:
    ORA-00904: "TEMP": invalid identifierI get the invalid identifier error on pretty much any attempt to get to the data. This seems to be something that's easy to do but I just can't figure it out. Any help would be appreciated, thanks!

    Have a look at this thread and scroll all the way to the bottom
    http://asktom.oracle.com/pls/ask/f?p=4950:8:11331947847331890504::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:110612348061,
    Regards,
    Steve Rooney

  • What will be data type for the newly created Service Interface def.?

    hi @,
    I am using new Service interface for the start event with objective that any outside application will be able to trigger the BPM. I have created the same SI and its operation and Input params. Now when the request comes there is an exclusive choice gateway which based upon the input fields decide which path to take into consideration. Now I need to map the SI input to the Data object but which data type I need to use ideally it should be the data type defined in the Service Interface should be used but I am not able to locate the same in the data type folder .
    How can I map the input service interface data type to the Data object so that it is available in the next BPM steps?
    Thanks,

    Hi,
    Typically the used types in a new service interface are anonymous. Try making the used complex type a global one (Right-Click onto it -> Refactor -> Make Anonymous Type Global).
    Afterwards you could use the speed button around your your 'start event' and create a new 'data object' from there. Now the IDE automatically assigns the type of the service interface to your 'data object' and  performs the standard mapping between the 'start event' and the 'data object' in addition.
    Please also have a look at the documentation for further information:
    Accelerated Modeling with Speed Buttons
    http://help.sap.com/saphelp_nwce711/helpdata/en/16/52f063cac643d2917347aab86930ef/frameset.htm
    There is also an interesting blog entry dealing with data objects and their reuse:
    How to avoid modeling errors in Netweaver BPM? Part 3: Data flow in style
    /people/soeren.balko/blog/2009/02/03/how-to-avoid-modeling-errors-in-netweaver-bpm-part-3-data-flow-in-style
    Hope that helps,
    Martin

  • How do i find out  what is the data type of a column of a Table in oracle or SQL?

    a) What if i want to find out the  Datatype of a specific column in the Table.
    b) How do i find the Column Datatypes?
    Can anyone please help me. I am new to oracle and Trying to Learn some stuff

    Hi,
    How about doing
    SQL> desc <table_name>
    SQL> desc emp
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)

  • What is the data type of the value returned by the List box prompt in crystal

    Post Author: Mudit Kothiyal
    CA Forum: Formula
    Hi all,
    I am creating a report which has a list box prompt. When I am selecting a single value from the list box the report is working fine, but when I am selecting multiple values its not returning any data( although data is there). Does anyone know how the prompt values are passed to the report query by the crystal. I kno it passes the value to the report as an array. But how does it pass the value to the report query.
    I am using command query to fetch data from the DB.
    Crystal Report Version: Crystal Report XI R2.
    DB: Oracle 10g
    Also does anyone know how to pass the values of the list box prompt to the report query in comma seperated format.
    Thanks & regards,
    Mudit

    Post Author: rcoleman
    CA Forum: Formula
    In regards to the latter part of your question
    The following examples are applicable to Basic and Crystal syntax.
    The examples assume that list is a String array consisting of the 3 elements: "Chocolate", "Vanilla" and "Strawberry".
    Join (list)
    Returns the String "Chocolate Vanilla Strawberry".
    Join (list, "***")
    Returns the String "Chocolate**Vanilla**Strawberry".
    Not sure about the first part of your question,sorry.

Maybe you are looking for

  • SOA FTP Adapter error

    Ok so i created a new project an ESB project, i went to my ESB console and create a service/group to use. I placed an ftp adpter called get ( to get), Then i choose ascii and the opration of get for that adapter. The jndi name i choose was one inside

  • Error in MB1C Msg There is no item category assigned to account 799999/4050

    I am getting for MB1C movement type 561 There is no item category assigned to account 799999/4050 I checked g/l account & seems Item category reference tab is missing But could not figured what is this & how to resolve? Is it error in filed selection

  • Problem with calculation in report.

    please let me know about below code . What can be possible errors .Because I didn't get true calculations . My purpose is to get ztab-pvprs for every material. CLEAR atab . REFRESH atab .   SELECT smblnr sbudat z~matnr          zwerks zbwart z~menge

  • Error 51 when posting IDOC to SD

    Hello All, We are changing our EDI translator which had a SAP extension automatically process the IDocs into SAP using ALE process. I'm testing the new procedure scheduling a job to run RSEINB00. The error I'm getting is (51 enter a numeric value) wh

  • Why Is The New Click Wheel TERRIBLE?

    What happened to the flawless design of the click wheel on all previous ipod models. The new click wheel on the iPod classic is absolutely terrible. It is unresponsive, highly unsensitive, slow and works maybe half the time especially when scrolling