Thread: [Jsdsi-users] extending jsdsi.Tag
Status: Pre-Alpha
Brought to you by:
sajma
From: <gu...@cc...> - 2004-04-27 10:47:56
|
Hi, I have a little question regarding jsdsi.Tag. I need to create an application specific Tag and I was wondering if the abstract class Tag is intended to be extended by external sw packages. If this is the case, the method Tag.toTagSexp() shouldn't it be declared public or protected? In the latests stable version and current CVS version is is package-private. And if this is not the case, which is the best way to implement an application-specific tag? thanks, Guillermo -- --------------------------------------------------------------- Guillermo Navarro (gna...@cc...) Phone: +34 93 581 3577 FAX: +34 93 581 3033 Home: http://www.ccd.uab.es/~guille Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain --------------------------------------------------------------- |
From: Sameer A. <aj...@cs...> - 2004-04-27 12:58:11
|
Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() just returns <tag-material>. This just matters for when you write tags to a file or to the network (you should always use toSexp(), so that the receiver knows that it's getting a Tag). To construct application-specific tags, just use the Tag subclasses. For example, a tag like this: (tag (file (*set read write) (*prefix /home/ajmani))) Is constructed as: new SimpleTag("file", new ExprTag[] { new SetTag(new ExprTag[] { new StringTag("read"), new StringTag("write") }), new PrefixTag("/home/ajmani"); }; ).toSexp(); or parse the original string into an object: Tag myTag = (Tag)Obj.parseObj (new SexpInputString (new ByteArrayInputStream (Sexp.encodeString ("(tag (file (*set read write) (*prefix /home/ajmani)))") )).readSexp()); Sameer > Hi, > > I have a little question regarding jsdsi.Tag. I need to create an > application specific Tag and I was wondering if the abstract class Tag > is intended to be extended by external sw packages. > > If this is the case, the method Tag.toTagSexp() shouldn't it be > declared public or protected? In the latests stable version and > current CVS version is is package-private. And if this is not the > case, which is the best way to implement an application-specific tag? > > > thanks, > > Guillermo > > -- > --------------------------------------------------------------- > Guillermo Navarro (gna...@cc...) > Phone: +34 93 581 3577 > FAX: +34 93 581 3033 > Home: http://www.ccd.uab.es/~guille > Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > --------------------------------------------------------------- > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For > a limited time only, get FREE Ground shipping on all orders of $35 or > more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Jsdsi-users mailing list > Jsd...@li... > https://lists.sourceforge.net/lists/listinfo/jsdsi-users http://ajmani.net |
From: Guillermo N. <gna...@cc...> - 2004-04-27 14:06:21
|
Sameer Ajmani <aj...@cs...> writes: > Would making toTagSexp() protected solve your problem? We can probably do > this. yes, it will be perfect. I think it will allow others to provide specific tags with their own intersect() methods without modifying the jsdsi package by extending Tag. (again, I don't know if it is a good practice or if it should be allowed, but at least i find it useful). guillermo > > Sameer > >> >> Thanks a lot for the answer and the advice, >> >>> To construct application-specific tags, just use the Tag subclasses. >> >> I wanted to create a new Tag object because the semantics of my >> authorization tag require a different intersect() function. I just >> though that I could extend jsdsi.Tag implementing the abstract >> methods, and providing my own intersect algorithm for my specific tag. >> >> If I implement my own Tag extending jsdsi.Tag I get an error because I >> cannot implement the abstract method Tag.toTagSexp(). Making it public >> in Tag solves the error, although I don't know if this is a good >> practice. >> >> Thanks again, >> >> Guillermo >> >> >> Sameer Ajmani <aj...@cs...> writes: >> >>> Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() just >>> returns <tag-material>. This just matters for when you write tags to >>> a file or to the network (you should always use toSexp(), so that the >>> receiver knows that it's getting a Tag). To construct >>> application-specific tags, just use the Tag subclasses. For example, >>> a tag like this: >>> (tag (file (*set read write) (*prefix /home/ajmani))) >>> Is constructed as: >>> new SimpleTag("file", >>> new ExprTag[] { >>> new SetTag(new ExprTag[] { new StringTag("read"), >>> new StringTag("write") }), >>> new PrefixTag("/home/ajmani"); >>> }; >>> ).toSexp(); >>> >>> or parse the original string into an object: >>> >>> Tag myTag = (Tag)Obj.parseObj >>> (new SexpInputString >>> (new ByteArrayInputStream >>> (Sexp.encodeString >>> ("(tag (file (*set read write) (*prefix /home/ajmani)))") >>> )).readSexp()); >>> >>> Sameer >>> >>>> Hi, >>>> >>>> I have a little question regarding jsdsi.Tag. I need to create an >>>> application specific Tag and I was wondering if the abstract class >>>> Tag is intended to be extended by external sw packages. >>>> >>>> If this is the case, the method Tag.toTagSexp() shouldn't it be >>>> declared public or protected? In the latests stable version and >>>> current CVS version is is package-private. And if this is not the >>>> case, which is the best way to implement an application-specific tag? >>>> >>>> >>>> thanks, >>>> >>>> Guillermo >>>> >>>> -- >>>> --------------------------------------------------------------- >>>> Guillermo Navarro (gna...@cc...) >>>> Phone: +34 93 581 3577 >>>> FAX: +34 93 581 3033 >>>> Home: http://www.ccd.uab.es/~guille >>>> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) >>>> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain >>>> --------------------------------------------------------------- >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>>> For a limited time only, get FREE Ground shipping on all orders of >>>> $35 or more. Hurry up and shop folks, this offer expires April 30th! >>>> http://www.thinkgeek.com/freeshipping/?cpg=12297 >>>> _______________________________________________ >>>> Jsdsi-users mailing list >>>> Jsd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users >>> >>> >>> http://ajmani.net >>> >>> >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>> For a limited time only, get FREE Ground shipping on all orders of $35 >>> or more. Hurry up and shop folks, this offer expires April 30th! >>> http://www.thinkgeek.com/freeshipping/?cpg=12297 >>> _______________________________________________ >>> Jsdsi-users mailing list >>> Jsd...@li... >>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users >>> >> >> -- >> --------------------------------------------------------------- >> Guillermo Navarro (gna...@cc...) >> Phone: +34 93 581 3577 >> FAX: +34 93 581 3033 >> Home: http://www.ccd.uab.es/~guille >> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) >> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain >> --------------------------------------------------------------- > > > http://ajmani.net > > > -- --------------------------------------------------------------- Guillermo Navarro (gna...@cc...) Phone: +34 93 581 3577 FAX: +34 93 581 3033 Home: http://www.ccd.uab.es/~guille Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain --------------------------------------------------------------- |
From: Sameer A. <aj...@cs...> - 2004-04-27 14:56:03
|
Ok, I've just checked a change into CVS that makes toTagSexp protected. Sameer > Sameer Ajmani <aj...@cs...> writes: > >> Would making toTagSexp() protected solve your problem? We can >> probably do this. > > yes, it will be perfect. > > I think it will allow others to provide specific tags with their own > intersect() methods without modifying the jsdsi package by extending > Tag. (again, I don't know if it is a good practice or if it should be > allowed, but at least i find it useful). > > > guillermo > >> >> Sameer >> >>> >>> Thanks a lot for the answer and the advice, >>> >>>> To construct application-specific tags, just use the Tag subclasses. >>> >>> I wanted to create a new Tag object because the semantics of my >>> authorization tag require a different intersect() function. I just >>> though that I could extend jsdsi.Tag implementing the abstract >>> methods, and providing my own intersect algorithm for my specific >>> tag. >>> >>> If I implement my own Tag extending jsdsi.Tag I get an error because >>> I cannot implement the abstract method Tag.toTagSexp(). Making it >>> public in Tag solves the error, although I don't know if this is a >>> good practice. >>> >>> Thanks again, >>> >>> Guillermo >>> >>> >>> Sameer Ajmani <aj...@cs...> writes: >>> >>>> Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() >>>> just returns <tag-material>. This just matters for when you write >>>> tags to a file or to the network (you should always use toSexp(), so >>>> that the receiver knows that it's getting a Tag). To construct >>>> application-specific tags, just use the Tag subclasses. For >>>> example, a tag like this: >>>> (tag (file (*set read write) (*prefix /home/ajmani))) >>>> Is constructed as: >>>> new SimpleTag("file", >>>> new ExprTag[] { >>>> new SetTag(new ExprTag[] { new StringTag("read"), >>>> new StringTag("write") }), >>>> new PrefixTag("/home/ajmani"); >>>> }; >>>> ).toSexp(); >>>> >>>> or parse the original string into an object: >>>> >>>> Tag myTag = (Tag)Obj.parseObj >>>> (new SexpInputString >>>> (new ByteArrayInputStream >>>> (Sexp.encodeString >>>> ("(tag (file (*set read write) (*prefix /home/ajmani)))") >>>> )).readSexp()); >>>> >>>> Sameer >>>> >>>>> Hi, >>>>> >>>>> I have a little question regarding jsdsi.Tag. I need to create an >>>>> application specific Tag and I was wondering if the abstract class >>>>> Tag is intended to be extended by external sw packages. >>>>> >>>>> If this is the case, the method Tag.toTagSexp() shouldn't it be >>>>> declared public or protected? In the latests stable version and >>>>> current CVS version is is package-private. And if this is not the >>>>> case, which is the best way to implement an application-specific >>>>> tag? >>>>> >>>>> >>>>> thanks, >>>>> >>>>> Guillermo >>>>> >>>>> -- >>>>> --------------------------------------------------------------- >>>>> Guillermo Navarro (gna...@cc...) >>>>> Phone: +34 93 581 3577 >>>>> FAX: +34 93 581 3033 >>>>> Home: http://www.ccd.uab.es/~guille >>>>> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) >>>>> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain >>>>> --------------------------------------------------------------- >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------- >>>>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>>>> For a limited time only, get FREE Ground shipping on all orders of >>>>> $35 or more. Hurry up and shop folks, this offer expires April >>>>> 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 >>>>> _______________________________________________ >>>>> Jsdsi-users mailing list >>>>> Jsd...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users >>>> >>>> >>>> http://ajmani.net >>>> >>>> >>>> >>>> >>>> >>>> ------------------------------------------------------- >>>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>>> For a limited time only, get FREE Ground shipping on all orders of >>>> $35 or more. Hurry up and shop folks, this offer expires April 30th! >>>> http://www.thinkgeek.com/freeshipping/?cpg=12297 >>>> _______________________________________________ >>>> Jsdsi-users mailing list >>>> Jsd...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users >>>> >>> >>> -- >>> --------------------------------------------------------------- >>> Guillermo Navarro (gna...@cc...) >>> Phone: +34 93 581 3577 >>> FAX: +34 93 581 3033 >>> Home: http://www.ccd.uab.es/~guille >>> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) >>> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain >>> --------------------------------------------------------------- >> >> >> http://ajmani.net >> >> >> > > -- > --------------------------------------------------------------- > Guillermo Navarro (gna...@cc...) > Phone: +34 93 581 3577 > FAX: +34 93 581 3033 > Home: http://www.ccd.uab.es/~guille > Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > --------------------------------------------------------------- http://ajmani.net |
From: Sean R. <sra...@ae...> - 2004-04-28 08:49:36
|
Sorry guys - I've been in the hills out of email... Hello Guillermo, I hope, despite you're current probelme, that jsdsi is proving fun. I guess my only additional point regarding Tags is the need to extend the jsdsi provided ones in the first place. When I first started with jsdsi I kept wanting to myself, but now that I have a better understanding of it all can see how the existing ones can be used to meet most (all) purposes. Guillermo, would you like some suggestions on how (if it is possible) you might model your tags using the jsdsi classes? Regards, Sean On Tue, 2004-04-27 at 15:55, Sameer Ajmani wrote: > Ok, I've just checked a change into CVS that makes toTagSexp protected. > > Sameer > > > Sameer Ajmani <aj...@cs...> writes: > > > >> Would making toTagSexp() protected solve your problem? We can > >> probably do this. > > > > yes, it will be perfect. > > > > I think it will allow others to provide specific tags with their own > > intersect() methods without modifying the jsdsi package by extending > > Tag. (again, I don't know if it is a good practice or if it should be > > allowed, but at least i find it useful). > > > > > > guillermo > > > >> > >> Sameer > >> > >>> > >>> Thanks a lot for the answer and the advice, > >>> > >>>> To construct application-specific tags, just use the Tag subclasses. > >>> > >>> I wanted to create a new Tag object because the semantics of my > >>> authorization tag require a different intersect() function. I just > >>> though that I could extend jsdsi.Tag implementing the abstract > >>> methods, and providing my own intersect algorithm for my specific > >>> tag. > >>> > >>> If I implement my own Tag extending jsdsi.Tag I get an error because > >>> I cannot implement the abstract method Tag.toTagSexp(). Making it > >>> public in Tag solves the error, although I don't know if this is a > >>> good practice. > >>> > >>> Thanks again, > >>> > >>> Guillermo > >>> > >>> > >>> Sameer Ajmani <aj...@cs...> writes: > >>> > >>>> Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() > >>>> just returns <tag-material>. This just matters for when you write > >>>> tags to a file or to the network (you should always use toSexp(), so > >>>> that the receiver knows that it's getting a Tag). To construct > >>>> application-specific tags, just use the Tag subclasses. For > >>>> example, a tag like this: > >>>> (tag (file (*set read write) (*prefix /home/ajmani))) > >>>> Is constructed as: > >>>> new SimpleTag("file", > >>>> new ExprTag[] { > >>>> new SetTag(new ExprTag[] { new StringTag("read"), > >>>> new StringTag("write") }), > >>>> new PrefixTag("/home/ajmani"); > >>>> }; > >>>> ).toSexp(); > >>>> > >>>> or parse the original string into an object: > >>>> > >>>> Tag myTag = (Tag)Obj.parseObj > >>>> (new SexpInputString > >>>> (new ByteArrayInputStream > >>>> (Sexp.encodeString > >>>> ("(tag (file (*set read write) (*prefix /home/ajmani)))") > >>>> )).readSexp()); > >>>> > >>>> Sameer > >>>> > >>>>> Hi, > >>>>> > >>>>> I have a little question regarding jsdsi.Tag. I need to create an > >>>>> application specific Tag and I was wondering if the abstract class > >>>>> Tag is intended to be extended by external sw packages. > >>>>> > >>>>> If this is the case, the method Tag.toTagSexp() shouldn't it be > >>>>> declared public or protected? In the latests stable version and > >>>>> current CVS version is is package-private. And if this is not the > >>>>> case, which is the best way to implement an application-specific > >>>>> tag? > >>>>> > >>>>> > >>>>> thanks, > >>>>> > >>>>> Guillermo > >>>>> > >>>>> -- > >>>>> --------------------------------------------------------------- > >>>>> Guillermo Navarro (gna...@cc...) > >>>>> Phone: +34 93 581 3577 > >>>>> FAX: +34 93 581 3033 > >>>>> Home: http://www.ccd.uab.es/~guille > >>>>> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > >>>>> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > >>>>> --------------------------------------------------------------- > >>>>> > >>>>> > >>>>> > >>>>> ------------------------------------------------------- > >>>>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > >>>>> For a limited time only, get FREE Ground shipping on all orders of > >>>>> $35 or more. Hurry up and shop folks, this offer expires April > >>>>> 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 > >>>>> _______________________________________________ > >>>>> Jsdsi-users mailing list > >>>>> Jsd...@li... > >>>>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users > >>>> > >>>> > >>>> http://ajmani.net > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> ------------------------------------------------------- > >>>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > >>>> For a limited time only, get FREE Ground shipping on all orders of > >>>> $35 or more. Hurry up and shop folks, this offer expires April 30th! > >>>> http://www.thinkgeek.com/freeshipping/?cpg=12297 > >>>> _______________________________________________ > >>>> Jsdsi-users mailing list > >>>> Jsd...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users > >>>> > >>> > >>> -- > >>> --------------------------------------------------------------- > >>> Guillermo Navarro (gna...@cc...) > >>> Phone: +34 93 581 3577 > >>> FAX: +34 93 581 3033 > >>> Home: http://www.ccd.uab.es/~guille > >>> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > >>> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > >>> --------------------------------------------------------------- > >> > >> > >> http://ajmani.net > >> > >> > >> > > > > -- > > --------------------------------------------------------------- > > Guillermo Navarro (gna...@cc...) > > Phone: +34 93 581 3577 > > FAX: +34 93 581 3033 > > Home: http://www.ccd.uab.es/~guille > > Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > > Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > > --------------------------------------------------------------- > > > http://ajmani.net > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Jsdsi-users mailing list > Jsd...@li... > https://lists.sourceforge.net/lists/listinfo/jsdsi-users -- Dr. Sean Radford, MBBS, MSc sra...@ae... http://www.aegeus-technology.com |
From: Guillermo N. <gna...@cc...> - 2004-04-27 15:05:53
|
Thanks a lot for the answer and the advice, > To construct application-specific tags, just use the Tag subclasses. I wanted to create a new Tag object because the semantics of my authorization tag require a different intersect() function. I just though that I could extend jsdsi.Tag implementing the abstract methods, and providing my own intersect algorithm for my specific tag. If I implement my own Tag extending jsdsi.Tag I get an error because I cannot implement the abstract method Tag.toTagSexp(). Making it public in Tag solves the error, although I don't know if this is a good practice. Thanks again, Guillermo Sameer Ajmani <aj...@cs...> writes: > Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() just > returns <tag-material>. This just matters for when you write tags to a > file or to the network (you should always use toSexp(), so that the > receiver knows that it's getting a Tag). To construct > application-specific tags, just use the Tag subclasses. For example, a > tag like this: > (tag (file (*set read write) (*prefix /home/ajmani))) > Is constructed as: > new SimpleTag("file", > new ExprTag[] { > new SetTag(new ExprTag[] { new StringTag("read"), > new StringTag("write") }), > new PrefixTag("/home/ajmani"); > }; > ).toSexp(); > > or parse the original string into an object: > > Tag myTag = (Tag)Obj.parseObj > (new SexpInputString > (new ByteArrayInputStream > (Sexp.encodeString > ("(tag (file (*set read write) (*prefix /home/ajmani)))") > )).readSexp()); > > Sameer > >> Hi, >> >> I have a little question regarding jsdsi.Tag. I need to create an >> application specific Tag and I was wondering if the abstract class Tag >> is intended to be extended by external sw packages. >> >> If this is the case, the method Tag.toTagSexp() shouldn't it be >> declared public or protected? In the latests stable version and >> current CVS version is is package-private. And if this is not the >> case, which is the best way to implement an application-specific tag? >> >> >> thanks, >> >> Guillermo >> >> -- >> --------------------------------------------------------------- >> Guillermo Navarro (gna...@cc...) >> Phone: +34 93 581 3577 >> FAX: +34 93 581 3033 >> Home: http://www.ccd.uab.es/~guille >> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) >> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain >> --------------------------------------------------------------- >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For >> a limited time only, get FREE Ground shipping on all orders of $35 or >> more. Hurry up and shop folks, this offer expires April 30th! >> http://www.thinkgeek.com/freeshipping/?cpg=12297 >> _______________________________________________ >> Jsdsi-users mailing list >> Jsd...@li... >> https://lists.sourceforge.net/lists/listinfo/jsdsi-users > > > http://ajmani.net > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Jsdsi-users mailing list > Jsd...@li... > https://lists.sourceforge.net/lists/listinfo/jsdsi-users > -- --------------------------------------------------------------- Guillermo Navarro (gna...@cc...) Phone: +34 93 581 3577 FAX: +34 93 581 3033 Home: http://www.ccd.uab.es/~guille Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain --------------------------------------------------------------- |
From: Sameer A. <aj...@cs...> - 2004-04-27 13:46:46
|
Would making toTagSexp() protected solve your problem? We can probably do this. Sameer > > Thanks a lot for the answer and the advice, > >> To construct application-specific tags, just use the Tag subclasses. > > I wanted to create a new Tag object because the semantics of my > authorization tag require a different intersect() function. I just > though that I could extend jsdsi.Tag implementing the abstract > methods, and providing my own intersect algorithm for my specific tag. > > If I implement my own Tag extending jsdsi.Tag I get an error because I > cannot implement the abstract method Tag.toTagSexp(). Making it public > in Tag solves the error, although I don't know if this is a good > practice. > > Thanks again, > > Guillermo > > > Sameer Ajmani <aj...@cs...> writes: > >> Tag.toSexp() returns (tag <tag-material>), while Tag.toTagSexp() just >> returns <tag-material>. This just matters for when you write tags to >> a file or to the network (you should always use toSexp(), so that the >> receiver knows that it's getting a Tag). To construct >> application-specific tags, just use the Tag subclasses. For example, >> a tag like this: >> (tag (file (*set read write) (*prefix /home/ajmani))) >> Is constructed as: >> new SimpleTag("file", >> new ExprTag[] { >> new SetTag(new ExprTag[] { new StringTag("read"), >> new StringTag("write") }), >> new PrefixTag("/home/ajmani"); >> }; >> ).toSexp(); >> >> or parse the original string into an object: >> >> Tag myTag = (Tag)Obj.parseObj >> (new SexpInputString >> (new ByteArrayInputStream >> (Sexp.encodeString >> ("(tag (file (*set read write) (*prefix /home/ajmani)))") >> )).readSexp()); >> >> Sameer >> >>> Hi, >>> >>> I have a little question regarding jsdsi.Tag. I need to create an >>> application specific Tag and I was wondering if the abstract class >>> Tag is intended to be extended by external sw packages. >>> >>> If this is the case, the method Tag.toTagSexp() shouldn't it be >>> declared public or protected? In the latests stable version and >>> current CVS version is is package-private. And if this is not the >>> case, which is the best way to implement an application-specific tag? >>> >>> >>> thanks, >>> >>> Guillermo >>> >>> -- >>> --------------------------------------------------------------- >>> Guillermo Navarro (gna...@cc...) >>> Phone: +34 93 581 3577 >>> FAX: +34 93 581 3033 >>> Home: http://www.ccd.uab.es/~guille >>> Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) >>> Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain >>> --------------------------------------------------------------- >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>> For a limited time only, get FREE Ground shipping on all orders of >>> $35 or more. Hurry up and shop folks, this offer expires April 30th! >>> http://www.thinkgeek.com/freeshipping/?cpg=12297 >>> _______________________________________________ >>> Jsdsi-users mailing list >>> Jsd...@li... >>> https://lists.sourceforge.net/lists/listinfo/jsdsi-users >> >> >> http://ajmani.net >> >> >> >> >> >> ------------------------------------------------------- >> This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >> For a limited time only, get FREE Ground shipping on all orders of $35 >> or more. Hurry up and shop folks, this offer expires April 30th! >> http://www.thinkgeek.com/freeshipping/?cpg=12297 >> _______________________________________________ >> Jsdsi-users mailing list >> Jsd...@li... >> https://lists.sourceforge.net/lists/listinfo/jsdsi-users >> > > -- > --------------------------------------------------------------- > Guillermo Navarro (gna...@cc...) > Phone: +34 93 581 3577 > FAX: +34 93 581 3033 > Home: http://www.ccd.uab.es/~guille > Combinatoria i Comunicacio Digital (http://www.ccd.uab.es) > Universitat Autonoma de Barcelona - 08193 Bellaterra, Spain > --------------------------------------------------------------- http://ajmani.net |
From: Sean R. <sra...@ae...> - 2004-04-28 22:37:49
|
On Wed, 2004-04-28 at 18:38, Guillermo Navarro wrote: > Hi, > > Thanks for your interest. I'm still working on it and as you said I > may find a way to encode the tags so I can use the existing tags (I'm > testing several approaches). > > At the moment I use a tag which looks like: > > (tag (my-kind-of-auth (index 3) (id 453455) (val <byte-string>))) > > It is an element of a hash chain. The "val" is an element "index" of > the hash chain "id". > > The intersection function, is something like: given two tags, the > resulting intersection is the one with a lower index, only if both > id's are equal, and we can verify the value of the corresponding hash, > otherwise the intersection is null. > As an idea, could the 'index' be a SetTag, where index 3 equates to (index (* set 1 2 3)). Therefore the intersection of (index (* set 1 2 3 4)) and (index (* set 1 2)) is (index (* set 1 2)). Unsure of what you mean about verifying the value of the hash. Is the hash the bytes-string in (val (byte-string))? What is it a hash of? > As I said, I'm still working on it and I'm not sure how will it end > (if this ends in anything). I will let you know more details as soon > as I have more details or something more sound (I'm in a very > primitive stage). Thanks anyway. > That's fine. Will be glad to try and help. Regards, Sean -- Dr. Sean Radford, MBBS, MSc sra...@ae... http://www.aegeus-technology.com |
From: Sameer A. <aj...@cs...> - 2004-04-28 23:01:34
|
Comments below... > On Wed, 2004-04-28 at 18:38, Guillermo Navarro wrote: >> Hi, >> >> Thanks for your interest. I'm still working on it and as you said I >> may find a way to encode the tags so I can use the existing tags (I'm >> testing several approaches). >> >> At the moment I use a tag which looks like: >> >> (tag (my-kind-of-auth (index 3) (id 453455) (val <byte-string>))) >> >> It is an element of a hash chain. The "val" is an element "index" of >> the hash chain "id". >> >> The intersection function, is something like: given two tags, the >> resulting intersection is the one with a lower index, only if both >> id's are equal, and we can verify the value of the corresponding hash, >> otherwise the intersection is null. >> > As an idea, could the 'index' be a SetTag, where index 3 equates to > (index (* set 1 2 3)). Therefore the intersection of (index (* set 1 2 3 > 4)) and (index (* set 1 2)) is (index (* set 1 2)). Using SetTags won't scale well to large numbers of indexes. Instead, you can use a RangeTag to represent an arbitrarily large set: Represent index N as (index (*range numeric lt N)), for example: index 3 == (index (*range numeric lt 3)) index 1 == (index (*range numeric lt 1)) Then index 1 intersected with index 3 is the intersection of the ranges "less than 1" and "less than 3", which is "less than 1". (this is because the "less than" parameter is an _upper limit_, and a lower upper limit is more restrictive, and intersection returns the more restrictive range). Note also that "only if both id's are equal" works fine as you have it: (id 453455) will only intersect with another SimpleTag like (id 453455 ...) -- the "..." is there because SimpleTags can be extended (and so restricted), but this is irrelevant for what you're doing. I agree with Sean about the (val ...) tag -- what value did you hash? Sameer |