KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > rdf > model > impl > ModelCom


1 /*
2     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
3     [See end of file]
4     $Id: ModelCom.java,v 1.103 2005/04/08 13:51:54 der Exp $
5 */

6
7 package com.hp.hpl.jena.rdf.model.impl;
8
9 import com.hp.hpl.jena.rdf.model.*;
10 import com.hp.hpl.jena.shared.*;
11 import com.hp.hpl.jena.shared.impl.*;
12 import com.hp.hpl.jena.graph.*;
13 import com.hp.hpl.jena.graph.impl.*;
14 import com.hp.hpl.jena.graph.query.*;
15
16 import com.hp.hpl.jena.util.CollectionFactory;
17 import com.hp.hpl.jena.util.iterator.*;
18 import com.hp.hpl.jena.vocabulary.RDF;
19 import com.hp.hpl.jena.datatypes.*;
20 import com.hp.hpl.jena.datatypes.xsd.XSDDatatype;
21 import com.hp.hpl.jena.datatypes.xsd.XSDDateTime;
22 import com.hp.hpl.jena.enhanced.*;
23
24 import java.io.*;
25 import java.net.URL JavaDoc;
26 import java.util.*;
27
28 /** Common methods for model implementations.
29  *
30  * <P>This class implements common methods, mainly convenience methods, for
31  * model implementations. It is intended use is as a base class from which
32  * model implemenations can be derived.</P>
33  *
34  * @author bwm
35  * hacked by Jeremy, tweaked by Chris (May 2002 - October 2002)
36  */

37
38 public class ModelCom
39     extends EnhGraph
40     implements Model, PrefixMapping, ModelLock
41 {
42
43       private RDFReaderF readerFactory = new RDFReaderFImpl();
44       private RDFWriterF writerFactory = new RDFWriterFImpl();
45       private ModelLock modelLock = null ;
46       
47     /**
48         make a model based on the specified graph
49     */

50     public ModelCom( Graph base )
51         { this( base, BuiltinPersonalities.model ); }
52     
53     public ModelCom( Graph base, Personality personality )
54         { super( base, personality );
55         withDefaultMappings( defaultPrefixMapping ); }
56     
57     private static PrefixMapping defaultPrefixMapping = PrefixMapping.Factory.create();
58     
59     public static PrefixMapping getDefaultModelPrefixes()
60         { return defaultPrefixMapping; }
61     
62     public static PrefixMapping setDefaultModelPrefixes( PrefixMapping pm )
63         { PrefixMapping result = defaultPrefixMapping;
64         defaultPrefixMapping = pm;
65         return result; }
66     
67     public QueryHandler queryHandler()
68         { return getGraph().queryHandler(); }
69         
70     public Graph getGraph()
71         { return graph; }
72                
73     protected static Model createWorkModel()
74         { return ModelFactory.createDefaultModel(); }
75     
76     public RDFNode asRDFNode( Node n )
77         {
78         return n.isLiteral()
79           ? (RDFNode) this.getNodeAs( n, Literal.class )
80           : (RDFNode) this.getNodeAs( n, Resource.class );
81         }
82
83     /**
84         the ModelReifier does everything to do with reification.
85     */

86     protected ModelReifier modelReifier = new ModelReifier( this );
87     
88     public Resource getResource(String JavaDoc uri, ResourceF f) {
89         try {
90             return f.createResource(getResource(uri));
91         } catch (Exception JavaDoc e) {
92             throw new JenaException(e);
93         }
94     }
95     
96     public Model add(Resource s, Property p, boolean o) {
97         return add(s, p, String.valueOf( o ) );
98     }
99     
100     public Model add(Resource s, Property p, long o) {
101         return add(s, p, String.valueOf( o ) );
102     }
103     
104     public Model add(Resource s, Property p, char o) {
105         return add(s, p, String.valueOf( o ) );
106     }
107     
108     public Model add(Resource s, Property p, float o) {
109         return add(s, p, String.valueOf( o ) );
110     }
111     
112     public Model add(Resource s, Property p, double o) {
113         return add(s, p, String.valueOf( o ) );
114     }
115     
116     public Model add(Resource s, Property p, String JavaDoc o) {
117         return add( s, p, o, "", false );
118     }
119     
120     public Model add(Resource s, Property p, String JavaDoc o, boolean wellFormed)
121         {
122         add(s, p, literal(o, "", wellFormed));
123         return this;
124         }
125     
126     public Model add(Resource s, Property p, String JavaDoc o, String JavaDoc lang,
127       boolean wellFormed) {
128         add(s, p, literal(o, lang, wellFormed));
129         return this;
130     }
131     
132     private Literal literal( String JavaDoc s, String JavaDoc lang, boolean wellFormed )
133         { return new LiteralImpl( Node.createLiteral( s, lang, wellFormed), this ); }
134     
135     public Model add(Resource s, Property p, String JavaDoc o, String JavaDoc l)
136         { return add( s, p, o, l, false ); }
137     
138     /**
139         ensure that an object is an RDFNode. If it isn't, fabricate a literal
140         from its string representation. NOTE: probably proper data-typing
141         makes this suspect - Chris introduced it to abstract from some existing code.
142     */

143     private RDFNode ensureRDFNode( Object JavaDoc o )
144         {
145         return o instanceof RDFNode
146             ? (RDFNode) o
147             : literal( o.toString(), null, false )
148             ;
149         }
150         
151     public Model add(Resource s, Property p, Object JavaDoc o) {
152         return add( s, p, ensureRDFNode( o ) );
153     }
154     
155     public Model add( StmtIterator iter ) {
156         try { getBulkUpdateHandler().add( asTriples( iter ) ); }
157         finally { iter.close(); }
158         return this;
159     }
160     
161     public Model add( Model m )
162         { return add( m, false ); }
163         
164     public Model add( Model m, boolean suppressReifications ) {
165         getBulkUpdateHandler().add( m.getGraph(), !suppressReifications );
166         return this;
167     }
168     
169     public RDFReader getReader() {
170         return readerFactory.getReader();
171     }
172     
173     public RDFReader getReader(String JavaDoc lang) {
174         return readerFactory.getReader(lang);
175     }
176     
177     public String JavaDoc setReaderClassName(String JavaDoc lang, String JavaDoc className) {
178         return readerFactory.setReaderClassName(lang, className);
179     }
180     
181     public Model read(String JavaDoc url) {
182         readerFactory .getReader() .read(this, url);
183         return this;
184     }
185     
186     public Model read(Reader reader, String JavaDoc base) {
187         readerFactory .getReader() .read(this, reader, base);
188         return this;
189     }
190     
191     public Model read(InputStream reader, String JavaDoc base) {
192         readerFactory .getReader() .read(this, reader, base);
193         return this;
194     }
195     
196     public Model read(String JavaDoc url, String JavaDoc lang) {
197         readerFactory. getReader(lang) .read(this, url);
198         return this;
199     }
200     
201     public Model read( String JavaDoc url, String JavaDoc base, String JavaDoc lang )
202         {
203         try
204             {
205             InputStream is = new URL JavaDoc( url ) .openStream();
206             try { read( is, base, lang ); }
207             finally { is.close(); }
208             }
209         catch (IOException e) { throw new WrappedIOException( e ); }
210         return this;
211         }
212     
213     public Model read(Reader reader, String JavaDoc base, String JavaDoc lang)
214        {
215         readerFactory .getReader(lang) .read(this, reader, base);
216         return this;
217        }
218     
219     public Model read(InputStream reader, String JavaDoc base, String JavaDoc lang)
220        {
221         readerFactory .getReader(lang) .read(this, reader, base);
222         return this;
223     }
224
225     /**
226         Get the model's writer after priming it with the model's namespace
227         prefixes.
228     */

229     public RDFWriter getWriter() {
230         return writerFactory.getWriter();
231     }
232     
233     /**
234         Get the model's writer after priming it with the model's namespace
235         prefixes.
236     */

237     public RDFWriter getWriter(String JavaDoc lang) {
238         return writerFactory.getWriter(lang);
239     }
240     
241
242     public String JavaDoc setWriterClassName(String JavaDoc lang, String JavaDoc className) {
243         return writerFactory.setWriterClassName(lang, className);
244     }
245     
246     public Model write(Writer writer)
247         {
248         getWriter() .write(this, writer, "");
249         return this;
250         }
251     
252     public Model write(Writer writer, String JavaDoc lang)
253         {
254         getWriter(lang) .write(this, writer, "");
255         return this;
256         }
257     
258     public Model write(Writer writer, String JavaDoc lang, String JavaDoc base)
259         {
260         getWriter(lang) .write(this, writer, base);
261         return this;
262         }
263     
264     public Model write( OutputStream writer )
265         {
266         getWriter() .write(this, writer, "");
267         return this;
268         }
269     
270     public Model write(OutputStream writer, String JavaDoc lang)
271         {
272         getWriter(lang) .write(this, writer, "");
273         return this;
274         }
275     
276     public Model write(OutputStream writer, String JavaDoc lang, String JavaDoc base)
277         {
278         getWriter(lang) .write(this, writer, base);
279         return this;
280         }
281     
282     public Model remove(Statement s) {
283         graph.delete(s.asTriple());
284         return this;
285     }
286     
287     public Model remove( StmtIterator iter )
288         {
289         getBulkUpdateHandler().delete( asTriples( iter ) );
290         return this;
291         }
292     
293     public Model remove( Model m )
294         { return remove( m, false ); }
295         
296     public Model remove( Model m, boolean suppressReifications )
297         {
298         getBulkUpdateHandler().delete( m.getGraph(), !suppressReifications );
299         return this;
300         }
301     
302     public Model removeAll()
303         {
304         getGraph().getBulkUpdateHandler().removeAll();
305         return this;
306         }
307     
308     public Model removeAll( Resource s, Property p, RDFNode o )
309         {
310         getGraph().getBulkUpdateHandler().remove( asNode( s ), asNode( p ), asNode( o ) );
311         return this;
312         }
313         
314     public boolean contains( Resource s, Property p, boolean o )
315         { return contains(s, p, String.valueOf( o ) ); }
316     
317     public boolean contains( Resource s, Property p, long o )
318         { return contains(s, p, String.valueOf( o ) ); }
319     
320     public boolean contains( Resource s, Property p, char o )
321         { return contains(s, p, String.valueOf( o ) ); }
322     
323     public boolean contains( Resource s, Property p, float o )
324         { return contains(s, p, String.valueOf( o ) ); }
325     
326     public boolean contains( Resource s, Property p, double o )
327         { return contains(s, p, String.valueOf( o ) ); }
328     
329     public boolean contains(Resource s, Property p, String JavaDoc o)
330         { return contains(s, p, o, "" ); }
331     
332     public boolean contains(Resource s, Property p, String JavaDoc o, String JavaDoc l)
333         { return contains( s, p, literal( o, l, false ) ); }
334     
335     public boolean contains(Resource s, Property p, Object JavaDoc o)
336         { return contains( s, p, ensureRDFNode( o ) ); }
337     
338     public boolean containsAny(StmtIterator iter) {
339         while (iter.hasNext()) {
340             if (contains(iter.nextStatement())) return true;
341         }
342         return false;
343     }
344     
345     public boolean containsAll(StmtIterator iter) {
346         while (iter.hasNext()) {
347             if (!contains(iter.nextStatement())) return false;
348         }
349         return true;
350     }
351     
352     public boolean containsAny(Model model) {
353         StmtIterator iter = model.listStatements();
354         try { return containsAny(iter); }
355         finally { iter.close(); }
356     }
357     
358     public boolean containsAll(Model model) {
359         StmtIterator iter = model.listStatements();
360         try { return containsAll(iter); }
361         finally { iter.close(); }
362     }
363     
364     public StmtIterator listStatements(Resource subject,
365                                         Property predicate,
366                                         RDFNode object)
367         { return listStatements( new SimpleSelector( subject, predicate, object ) ); }
368     
369     public StmtIterator listStatements(Resource subject,
370                                         Property predicate,
371                                         boolean object)
372         { return listStatements( new SimpleSelector( subject, predicate, object ) ); }
373     
374     public StmtIterator listStatements(Resource subject,
375                                         Property predicate,
376                                         long object)
377         { return listStatements( new SimpleSelector( subject, predicate, object ) ); }
378     
379     public StmtIterator listStatements(Resource subject,
380                                         Property predicate,
381                                         char object)
382         { return listStatements( new SimpleSelector( subject, predicate, object ) ); }
383     
384     public StmtIterator listStatements(Resource subject,
385                                         Property predicate,
386                                         float object)
387          { return listStatements( new SimpleSelector( subject, predicate, object ) ); }
388     
389     public StmtIterator listStatements(Resource subject,
390                                         Property predicate,
391                                         double object)
392         { return listStatements( new SimpleSelector(subject, predicate, object ) ); }
393     
394     public StmtIterator listStatements(Resource subject,
395                                         Property predicate,
396                                         String JavaDoc object)
397         { return listStatements( new SimpleSelector(subject, predicate, object ) ); }
398     
399     public StmtIterator listStatements(Resource subject,
400                                         Property predicate,
401                                         String JavaDoc object,
402                                         String JavaDoc lang)
403         { return listStatements( new SimpleSelector(subject, predicate, object, lang ) ); }
404     
405     public ResIterator listSubjectsWithProperty(Property p, boolean o)
406      {
407         return listSubjectsWithProperty(p, String.valueOf( o ) );
408     }
409     
410     public ResIterator listSubjectsWithProperty(Property p, long o)
411      {
412         return listSubjectsWithProperty(p, String.valueOf( o ) );
413     }
414     
415     public ResIterator listSubjectsWithProperty(Property p, char o)
416      {
417         return listSubjectsWithProperty(p, String.valueOf( o ) );
418     }
419     
420     public ResIterator listSubjectsWithProperty(Property p, float o)
421      {
422         return listSubjectsWithProperty(p, String.valueOf( o ) );
423     }
424     
425     public ResIterator listSubjectsWithProperty(Property p, double o)
426      {
427         return listSubjectsWithProperty(p, String.valueOf( o ) );
428     }
429     
430     public ResIterator listSubjectsWithProperty(Property p, String JavaDoc o)
431      {
432         return listSubjectsWithProperty( p, o, "" );
433     }
434     
435     public ResIterator listSubjectsWithProperty(Property p, String JavaDoc o, String JavaDoc l)
436      {
437         return listSubjectsWithProperty(p, literal( o, l, false ) );
438     }
439     
440     public ResIterator listSubjectsWithProperty(Property p, Object JavaDoc o)
441      {
442         return listSubjectsWithProperty( p, ensureRDFNode( o ) );
443     }
444     
445     public Resource createResource(Resource type) {
446         return createResource().addProperty(RDF.type, type);
447     }
448     
449     public Resource createResource(String JavaDoc uri,Resource type)
450      {
451         return getResource(uri)
452                    .addProperty(RDF.type, type);
453     }
454     
455     public Resource createResource(ResourceF f) {
456         return createResource(null, f);
457     }
458     
459     public Resource createResource( AnonId id )
460         { return new ResourceImpl( id, this ); }
461         
462     public Resource createResource(String JavaDoc uri, ResourceF f) {
463        return f.createResource( createResource( uri ) );
464     }
465     
466  
467     /** create a type literal from a boolean value.
468      *
469      * <p> The value is converted to a string using its <CODE>toString</CODE>
470      * method. </p>
471      * @param v the value of the literal
472      *
473      * @return a new literal representing the value v
474      */

475     public Literal createTypedLiteral(boolean v) {
476         return createTypedLiteral(new Boolean JavaDoc(v));
477     }
478     
479     /** create a typed literal from an integer value.
480      *
481      * @param v the value of the literal
482      *
483      * @return a new literal representing the value v
484      */

485     public Literal createTypedLiteral(int v) {
486         return createTypedLiteral(new Integer JavaDoc(v));
487     }
488     
489     /** create a typed literal from a long integer value.
490      *
491      * @param v the value of the literal
492      *
493      * @return a new literal representing the value v
494      */

495     public Literal createTypedLiteral(long v) {
496         return createTypedLiteral(new Long JavaDoc(v));
497     }
498     
499     /** create a typed literal from a char value.
500      *
501      * @param v the value of the literal
502      *
503      * @return a new literal representing the value v
504      */

505     public Literal createTypedLiteral(char v) {
506         return createTypedLiteral(new Character JavaDoc(v));
507     }
508     
509     /** create a typed literal from a float value.
510      *
511      * @param v the value of the literal
512      *
513      * @return a new literal representing the value v
514      */

515     public Literal createTypedLiteral(float v) {
516         return createTypedLiteral(new Float JavaDoc(v));
517     }
518     
519     /** create a typed literal from a double value.
520      *
521      * @param v the value of the literal
522      *
523      * @return a new literal representing the value v
524      */

525     public Literal createTypedLiteral(double v) {
526         return createTypedLiteral(new Double JavaDoc(v));
527     }
528     
529     /** create a typed literal from a String value.
530      *
531      * @param v the value of the literal
532      *
533      * @return a new literal representing the value v
534      */

535     public Literal createTypedLiteral(String JavaDoc v) {
536         LiteralLabel ll = new LiteralLabel(v);
537         return new LiteralImpl(Node.createLiteral(ll), this);
538     }
539
540     /**
541      * Create a typed literal xsd:dateTime from a Calendar object.
542      */

543     public Literal createTypedLiteral(Calendar cal) {
544         Object JavaDoc value = new XSDDateTime(cal);
545         LiteralLabel ll = new LiteralLabel(value, "", XSDDatatype.XSDdateTime);
546         return new LiteralImpl(Node.createLiteral(ll), this);
547         
548     }
549     
550     /**
551      * Build a typed literal from its lexical form. The
552      * lexical form will be parsed now and the value stored. If
553      * the form is not legal this will throw an exception.
554      *
555      * @param lex the lexical form of the literal
556      * @param dtype the type of the literal, null for old style "plain" literals
557      * @throws DatatypeFormatException if lex is not a legal form of dtype
558      */

559     public Literal createTypedLiteral(String JavaDoc lex, RDFDatatype dtype)
560                                         throws DatatypeFormatException {
561         LiteralLabel ll = new LiteralLabel(lex, "", dtype);
562         return new LiteralImpl(Node.createLiteral(ll), this);
563     }
564     
565     /**
566      * Build a typed literal from its value form.
567      *
568      * @param value the value of the literal
569      * @param dtype the type of the literal, null for old style "plain" literals
570      */

571     public Literal createTypedLiteral(Object JavaDoc value, RDFDatatype dtype) {
572         LiteralLabel ll = new LiteralLabel(value, "", dtype);
573         return new LiteralImpl( Node.createLiteral(ll), this );
574     }
575
576     /**
577      * Build a typed literal from its lexical form. The
578      * lexical form will be parsed now and the value stored. If
579      * the form is not legal this will throw an exception.
580      *
581      * @param lex the lexical form of the literal
582      * @param typeURI the uri of the type of the literal, null for old style "plain" literals
583      * @throws DatatypeFormatException if lex is not a legal form of dtype
584      */

585     public Literal createTypedLiteral(String JavaDoc lex, String JavaDoc typeURI) {
586         RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(typeURI);
587         LiteralLabel ll = new LiteralLabel(lex, "", dt);
588         return new LiteralImpl( Node.createLiteral(ll), this );
589     }
590         
591     /**
592      * Build a typed literal from its value form.
593      *
594      * @param value the value of the literal
595      * @param typeURI the URI of the type of the literal, null for old style "plain" literals
596      */

597     public Literal createTypedLiteral(Object JavaDoc value, String JavaDoc typeURI) {
598         RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(typeURI);
599         LiteralLabel ll = new LiteralLabel(value, "", dt);
600         return new LiteralImpl(Node.createLiteral(ll), this);
601     }
602         
603     /**
604      * Build a typed literal label from its value form using
605      * whatever datatype is currently registered as the the default
606      * representation for this java class. No language tag is supplied.
607      * @param value the literal value to encapsulate
608      */

609     public Literal createTypedLiteral(Object JavaDoc value) {
610         // Catch special case of a Calendar which we want to act as if it were an XSDDateTime
611
if (value instanceof Calendar) {
612             return createTypedLiteral((Calendar)value);
613         }
614         LiteralLabel ll = new LiteralLabel(value);
615         return new LiteralImpl(Node.createLiteral(ll), this);
616     }
617
618     public Literal createLiteral(boolean v)
619         { return createLiteral(String.valueOf(v), ""); }
620     
621     public Literal createLiteral(int v) {
622         return createLiteral(String.valueOf(v), "");
623     }
624     
625     public Literal createLiteral(long v) {
626         return createLiteral(String.valueOf(v), "");
627     }
628     
629     public Literal createLiteral(char v) {
630         return createLiteral(String.valueOf(v), "");
631     }
632     
633     public Literal createLiteral(float v) {
634         return createLiteral(String.valueOf(v), "");
635     }
636     
637     public Literal createLiteral(double v) {
638         return createLiteral(String.valueOf(v), "");
639     }
640     
641     public Literal createLiteral(String JavaDoc v) {
642         return createLiteral(v, "");
643     }
644     
645     public Literal createLiteral(String JavaDoc v, String JavaDoc l) {
646         return literal(v, l, false);
647     }
648     
649     public Literal createLiteral(String JavaDoc v, boolean wellFormed) {
650         return literal(v, "", wellFormed);
651     }
652     
653     public Literal createLiteral(String JavaDoc v, String JavaDoc l, boolean wellFormed) {
654         return literal(v, l, wellFormed);
655     }
656     
657     public Literal createLiteral(Object JavaDoc v) {
658         return createLiteral(v.toString(), "");
659     }
660     
661     public Statement createStatement(Resource r, Property p, boolean o)
662      {
663         return createStatement(r, p, createLiteral(o));
664     }
665     
666     public Statement createStatement(Resource r, Property p, long o)
667      {
668         return createStatement(r, p, createLiteral(o));
669     }
670     
671     public Statement createStatement(Resource r, Property p, char o)
672      {
673         return createStatement(r, p, createLiteral(o));
674     }
675     
676     public Statement createStatement(Resource r, Property p, float o)
677      {
678         return createStatement(r, p, createLiteral(o));
679     }
680     
681     public Statement createStatement(Resource r, Property p, double o)
682      {
683         return createStatement(r, p, createLiteral(o));
684     }
685     
686     public Statement createStatement(Resource r, Property p, String JavaDoc o)
687      {
688         return createStatement(r, p, createLiteral(o));
689     }
690     
691     public Statement createStatement(Resource r, Property p, Object JavaDoc o)
692      {
693         return createStatement( r, p, ensureRDFNode( o ) );
694     }
695     
696     public Statement createStatement(Resource r, Property p, String JavaDoc o,
697                                      boolean wellFormed) {
698         return createStatement( r, p, o, "", wellFormed );
699     }
700     
701     public Statement createStatement(Resource r, Property p, String JavaDoc o, String JavaDoc l)
702        {
703         return createStatement( r, p, o, l, false );
704     }
705     
706     public Statement createStatement(Resource r, Property p, String JavaDoc o, String JavaDoc l,
707                                      boolean wellFormed) {
708         return createStatement(r, p, literal(o,l,wellFormed));
709     }
710     
711     public Bag createBag() {
712         return createBag(null);
713     }
714     
715     public Alt createAlt() {
716         return createAlt(null);
717     }
718     
719     public Seq createSeq() {
720         return createSeq(null);
721     }
722     
723     /**
724      * <p>Answer a new empty list</p>
725      * @return An RDF-encoded list of no elements
726      */

727     public RDFList createList() {
728         Resource list = getResource( RDF.nil.getURI() );
729         
730         return (RDFList) list.as( RDFList.class );
731     }
732     
733     
734     /**
735      * <p>Answer a new list containing the resources from the given iterator, in order.</p>
736      * @param members An iterator, each value of which is expected to be an RDFNode.
737      * @return An RDF-encoded list of the elements of the iterator
738      */

739     public RDFList createList( Iterator members ) {
740         RDFList list = createList();
741         
742         while (members != null && members.hasNext()) {
743             list = list.with( (RDFNode) members.next() );
744         }
745         
746         return list;
747     }
748     
749     
750     /**
751      * <p>Answer a new list containing the RDF nodes from the given array, in order</p>
752      * @param members An array of RDFNodes that will be the members of the list
753      * @return An RDF-encoded list
754      */

755     public RDFList createList( RDFNode[] members ) {
756         return createList( Arrays.asList( members ).iterator() );
757     }
758     
759     public RDFNode getRDFNode( Node n )
760         {
761         return n.isURI() || n.isBlank()
762             ? (RDFNode) new ResourceImpl( n, this )
763             : (RDFNode) new LiteralImpl( n, this );
764         }
765     
766     public Resource getResource(String JavaDoc uri) {
767         return IteratorFactory.asResource(makeURI(uri),this);
768     }
769     
770     public Property getProperty(String JavaDoc uri) {
771         if ( uri == null )
772              throw new InvalidPropertyURIException( null );
773         return IteratorFactory.asProperty(makeURI(uri),this);
774     }
775     
776     public Property getProperty(String JavaDoc nameSpace,String JavaDoc localName)
777        {
778         return getProperty(nameSpace+localName);
779     }
780     
781     public Seq getSeq(String JavaDoc uri) {
782       return (Seq)IteratorFactory.asResource(makeURI(uri),Seq.class, this);
783     }
784     
785     public Seq getSeq(Resource r) {
786         return (Seq) r.as( Seq.class );
787     }
788     
789     public Bag getBag(String JavaDoc uri) {
790       return (Bag)IteratorFactory.asResource(makeURI(uri),Bag.class, this);
791     }
792     
793     public Bag getBag(Resource r) {
794         return (Bag) r.as( Bag.class );
795     }
796     
797     static private Node makeURI(String JavaDoc uri) {
798         if ( uri == null )
799             return Node.createAnon(new AnonId());
800         else
801             return Node.createURI(uri);
802     }
803     
804     public Alt getAlt(String JavaDoc uri) {
805       return (Alt)IteratorFactory.asResource(makeURI(uri),Alt.class, this);
806     }
807     
808     public Alt getAlt(Resource r) {
809         return (Alt) r.as( Alt.class );
810     }
811     
812     public long size() {
813         return graph.size();
814     }
815
816     public boolean isEmpty()
817         { return graph.isEmpty(); }
818         
819     private void updateNamespace( Set set, Iterator it )
820         {
821         while (it.hasNext())
822             {
823             Node node = (Node) it.next();
824             if (node.isURI())
825                 {
826                 String JavaDoc uri = node.getURI();
827                 String JavaDoc ns = uri.substring( 0, Util.splitNamespace( uri ) );
828                 // String ns = IteratorFactory.asResource( node, this ).getNameSpace();
829
set.add( ns );
830                 }
831             }
832         }
833         
834     private Iterator listPredicates()
835         {
836 // Set predicates = CollectionFactory.createHashedSet();
837
// ClosableIterator it = graph.find( null, null, null );
838
// while (it.hasNext()) predicates.add( ((Triple) it.next()).getPredicate() );
839
// return predicates.iterator();
840
return getGraph().queryHandler().predicatesFor( Node.ANY, Node.ANY );
841         }
842      
843     private Iterator listTypes()
844         {
845         Set types = CollectionFactory.createHashedSet();
846         ClosableIterator it = graph.find( null, RDF.type.asNode(), null );
847         while (it.hasNext()) types.add( ((Triple) it.next()).getObject() );
848         return types.iterator();
849         }
850      
851     public NsIterator listNameSpaces() {
852         Set nameSpaces = CollectionFactory.createHashedSet();
853         updateNamespace( nameSpaces, listPredicates() );
854         updateNamespace( nameSpaces, listTypes() );
855         return new NsIteratorImpl(nameSpaces.iterator(), nameSpaces);
856     }
857     
858     private PrefixMapping getPrefixMapping()
859         { return getGraph().getPrefixMapping(); }
860         
861     public PrefixMapping lock()
862         {
863         getPrefixMapping().lock();
864         return this;
865         }
866         
867     public PrefixMapping setNsPrefix( String JavaDoc prefix, String JavaDoc uri )
868         {
869         getPrefixMapping().setNsPrefix( prefix, uri );
870         return this;
871         }
872         
873     public PrefixMapping removeNsPrefix( String JavaDoc prefix )
874         {
875         getPrefixMapping().removeNsPrefix( prefix );
876         return this;
877         }
878     
879     public PrefixMapping setNsPrefixes( PrefixMapping pm )
880         {
881         getPrefixMapping().setNsPrefixes( pm );
882         return this;
883         }
884         
885     public PrefixMapping setNsPrefixes( Map map )
886         {
887         getPrefixMapping().setNsPrefixes( map );
888         return this;
889         }
890     
891     public PrefixMapping withDefaultMappings( PrefixMapping other )
892         {
893         getPrefixMapping().withDefaultMappings( other );
894         return this;
895         }
896         
897     public String JavaDoc getNsPrefixURI( String JavaDoc prefix )
898         { return getPrefixMapping().getNsPrefixURI( prefix ); }
899
900     public String JavaDoc getNsURIPrefix( String JavaDoc uri )
901         { return getPrefixMapping().getNsURIPrefix( uri ); }
902                 
903     public Map getNsPrefixMap()
904         { return getPrefixMapping().getNsPrefixMap(); }
905         
906     public String JavaDoc expandPrefix( String JavaDoc prefixed )
907         { return getPrefixMapping().expandPrefix( prefixed ); }
908         
909     public String JavaDoc usePrefix( String JavaDoc uri )
910         { return getPrefixMapping().shortForm( uri ); }
911     
912     public String JavaDoc qnameFor( String JavaDoc uri )
913         { return getPrefixMapping().qnameFor( uri ); }
914     
915     public String JavaDoc shortForm( String JavaDoc uri )
916         { return getPrefixMapping().shortForm( uri ); }
917         
918     /**
919         Service method to update the namespaces of a Model given the
920         mappings from prefix names to sets of URIs.
921         
922         If the prefix maps to multiple URIs, then we discard it completely.
923         
924         @param the Model who's namespace is to be updated
925         @param ns the namespace map to add to the Model
926     */

927     public static void addNamespaces( Model m, Map ns )
928         {
929         PrefixMapping pm = m;
930         Iterator it = ns.entrySet().iterator();
931         while (it.hasNext())
932             {
933             Map.Entry e = (Map.Entry) it.next();
934             String JavaDoc key = (String JavaDoc) e.getKey();
935             Set values = (Set) e.getValue();
936             Set niceValues = CollectionFactory.createHashedSet();
937             Iterator them = values.iterator();
938             while (them.hasNext())
939                 {
940                 String JavaDoc uri = (String JavaDoc) them.next();
941                 if (PrefixMappingImpl.isNiceURI( uri )) niceValues.add( uri );
942                 }
943             if (niceValues.size() == 1)
944                 pm.setNsPrefix( key, (String JavaDoc) niceValues.iterator().next() );
945             }
946         }
947         
948     public StmtIterator listStatements() {
949         return IteratorFactory.asStmtIterator( GraphUtil.findAll( graph ), this);
950     }
951
952     /**
953         add a Statement to this Model by adding its SPO components.
954     */

955     public Model add(Statement s) {
956         add( s.getSubject(), s.getPredicate(), s.getObject() );
957         return this;
958     }
959     
960     /**
961         Add all the statements to the model by converting them to an array of corresponding
962         triples and removing those from the underlying graph.
963     */

964     public Model add( Statement [] statements )
965         {
966         getBulkUpdateHandler().add( StatementImpl.asTriples( statements ) );
967         return this;
968         }
969         
970     protected BulkUpdateHandler getBulkUpdateHandler()
971         { return getGraph().getBulkUpdateHandler(); }
972         
973     /**
974         Add all the statements to the model by converting the list to an array of
975         Statement and removing that.
976     */

977     public Model add( List statements )
978         {
979         getBulkUpdateHandler().add( asTriples( statements ) );
980         return this;
981         }
982         
983     private List asTriples( List statements )
984         {
985         List L = new ArrayList( statements.size() );
986         for (int i = 0; i < statements.size(); i += 1)
987             L.add( ((Statement) statements.get(i)).asTriple() );
988         return L;
989         }
990         
991     private Iterator asTriples( StmtIterator it )
992         { return new Map1Iterator( mapAsTriple, it ); }
993         
994     private Map1 mapAsTriple = new Map1()
995         { public Object JavaDoc map1( Object JavaDoc s ) { return ((Statement) s).asTriple(); } };
996         
997     /**
998         remove all the Statements from the model by converting them to triples and
999         removing those triples from the underlying graph.
1000    */

1001    public Model remove( Statement [] statements )
1002        {
1003        getBulkUpdateHandler().delete( StatementImpl.asTriples( statements ) );
1004        return this;
1005        }
1006     
1007     /**
1008        Remove all the Statements from the model by converting the List to a
1009        Statement [] and removing that.
1010     */

1011    public Model remove( List statements )
1012        {
1013        getBulkUpdateHandler().delete( asTriples( statements ) );
1014        return this;
1015        }
1016           
1017    public Model add(Resource s,Property p,RDFNode o) {
1018        modelReifier.noteIfReified( s, p, o );
1019        graph.add( Triple.create( s.asNode(), p.asNode(), o.asNode() ) );
1020        return this;
1021    }
1022    
1023    public ReificationStyle getReificationStyle()
1024        { return modelReifier.getReificationStyle(); }
1025        
1026    /**
1027        @return an iterator which delivers all the ReifiedStatements in this model
1028    */

1029    public RSIterator listReifiedStatements()
1030        { return modelReifier.listReifiedStatements(); }
1031
1032    /**
1033        @return an iterator each of whose elements is a ReifiedStatement in this
1034            model such that it's getStatement().equals( st )
1035    */

1036    public RSIterator listReifiedStatements( Statement st )
1037        { return modelReifier.listReifiedStatements( st ); }
1038                
1039    /**
1040        @return true iff this model has a reification of _s_ in some Statement
1041    */

1042    public boolean isReified( Statement s )
1043        { return modelReifier.isReified( s ); }
1044   
1045    /**
1046        get any reification of the given statement in this model; make
1047        one if necessary.
1048        
1049        @param s for which a reification is sought
1050        @return a ReifiedStatement that reifies _s_
1051    */

1052    public Resource getAnyReifiedStatement(Statement s)
1053        { return modelReifier.getAnyReifiedStatement( s ); }
1054    
1055    /**
1056        remove any ReifiedStatements reifying the given statement
1057        @param s the statement who's reifications are to be discarded
1058    */

1059    public void removeAllReifications( Statement s )
1060        { modelReifier.removeAllReifications( s ); }
1061        
1062    public void removeReification( ReifiedStatement rs )
1063        { modelReifier.removeReification( rs ); }
1064        
1065    /**
1066        create a ReifiedStatement that encodes _s_ and belongs to this Model.
1067    */

1068    public ReifiedStatement createReifiedStatement( Statement s )
1069        { return modelReifier.createReifiedStatement( s ); }
1070        
1071    public ReifiedStatement createReifiedStatement( String JavaDoc uri, Statement s )
1072        { return modelReifier.createReifiedStatement( uri, s ); }
1073    
1074    public boolean contains( Statement s )
1075        { return graph.contains( s.asTriple() ); }
1076    
1077    public boolean containsResource( RDFNode r )
1078        { return graph.queryHandler().containsNode( r.asNode() ); }
1079  
1080    public boolean contains( Resource s, Property p ) {
1081        ClosableIterator it = graph.find( asNode( s ), asNode( p ), null );
1082        try { return it.hasNext(); } finally { it.close(); }
1083    }
1084    
1085    public boolean contains( Resource s, Property p, RDFNode o )
1086        { return graph.contains( asNode( s ), asNode( p ), asNode( o ) ); }
1087        
1088    public Statement getRequiredProperty( Resource s, Property p )
1089        { Statement st = getProperty( s, p );
1090        if (st == null) throw new PropertyNotFoundException( p );
1091        return st; }
1092    
1093    public Statement getProperty( Resource s, Property p )
1094        {
1095        StmtIterator iter = listStatements( s, p, (RDFNode) null );
1096        try { return iter.hasNext() ? iter.nextStatement() : null; }
1097        finally { iter.close(); }
1098        }
1099    
1100    public static Node asNode( RDFNode x )
1101        { return x == null ? Node.ANY : x.asNode(); }
1102        
1103    private NodeIterator listObjectsFor( RDFNode s, RDFNode p )
1104        {
1105        ClosableIterator xit = graph.queryHandler().objectsFor( asNode( s ), asNode( p ) );
1106        return IteratorFactory.asRDFNodeIterator( xit, this );
1107        }
1108
1109    private ResIterator listSubjectsFor( RDFNode p, RDFNode o )
1110        {
1111        ClosableIterator xit = graph.queryHandler().subjectsFor( asNode( p ), asNode( o ) );
1112        return IteratorFactory.asResIterator( xit, this );
1113        }
1114                
1115    public ResIterator listSubjects()
1116        { return listSubjectsFor( null, null ); }
1117    
1118    public ResIterator listSubjectsWithProperty(Property p)
1119        { return listSubjectsFor( p, null ); }
1120    
1121    public ResIterator listSubjectsWithProperty(Property p, RDFNode o)
1122        { return listSubjectsFor( p, o ); }
1123    
1124    public NodeIterator listObjects()
1125        { return listObjectsFor( null, null ); }
1126    
1127    public NodeIterator listObjectsOfProperty(Property p)
1128        { return listObjectsFor( null, p ); }
1129    
1130    public NodeIterator listObjectsOfProperty(Resource s, Property p)
1131        { return listObjectsFor( s, p ); }
1132            
1133    public StmtIterator listStatements(final Selector selector)
1134        {
1135        StmtIterator sts = IteratorFactory.asStmtIterator( findTriplesFrom( selector ), this );
1136        return selector.isSimple()
1137            ? sts
1138            : new StmtIteratorImpl( sts .filterKeep ( asFilter( selector ) ) )
1139            ;
1140        }
1141    
1142    /**
1143        Answer a Filter that filters exactly those things the Selector selects.
1144        
1145        @param s a Selector on statements
1146        @return a Filter that accepts statements that s passes tests on
1147   */

1148    public Filter asFilter( final Selector s )
1149        { return new Filter()
1150                { public boolean accept( Object JavaDoc x ) { return s.test( (Statement) x ); } };
1151        }
1152        
1153    
1154    /**
1155        Answer an [extended] iterator which returns the triples in this graph which
1156        are selected by the (S, P, O) triple in the selector, ignoring any special
1157        tests it may do.
1158        
1159        @param s a Selector used to supply subject, predicate, and object
1160        @return an extended iterator over the matching (S, P, O) triples
1161    */

1162    public ExtendedIterator findTriplesFrom( Selector s )
1163        {
1164        return graph.find
1165            ( asNode( s.getSubject() ), asNode( s.getPredicate() ), asNode( s.getObject() ) );
1166        }
1167
1168    public boolean supportsTransactions()
1169        { return getTransactionHandler().transactionsSupported(); }
1170        
1171    public Model begin()
1172        { getTransactionHandler().begin(); return this; }
1173    
1174    public Model abort()
1175        { getTransactionHandler().abort(); return this; }
1176    
1177    public Model commit()
1178        { getTransactionHandler().commit(); return this; }
1179    
1180    public Object JavaDoc executeInTransaction( Command cmd )
1181        { return getTransactionHandler().executeInTransaction( cmd ); }
1182        
1183    private TransactionHandler getTransactionHandler()
1184        { return getGraph().getTransactionHandler(); }
1185        
1186    public boolean independent() {
1187        return true;
1188    }
1189    
1190    public Resource createResource() {
1191        return IteratorFactory.asResource(Node.createAnon(new AnonId()),this);
1192    }
1193    
1194    public Resource createResource(String JavaDoc uri) {
1195        return getResource(uri);
1196    }
1197    
1198    public Property createProperty(String JavaDoc uri) {
1199        return getProperty(uri);
1200    }
1201    
1202    public Property createProperty(String JavaDoc nameSpace, String JavaDoc localName)
1203     {
1204        return getProperty(nameSpace, localName);
1205    }
1206    
1207    /**
1208        create a Statement from the given r, p, and o.
1209    */

1210    public Statement createStatement(Resource r, Property p, RDFNode o)
1211     {
1212        return new StatementImpl( r, p, o, this );
1213    }
1214    
1215    public Bag createBag(String JavaDoc uri) {
1216        return (Bag) getBag(uri).addProperty(RDF.type, RDF.Bag);
1217    }
1218    
1219    public Alt createAlt(String JavaDoc uri) {
1220        return (Alt) getAlt(uri).addProperty(RDF.type, RDF.Alt);
1221    }
1222    
1223    public Seq createSeq(String JavaDoc uri) {
1224        return (Seq) getSeq(uri).addProperty(RDF.type, RDF.Seq);
1225    }
1226
1227    /**
1228        Answer a Statement in this Model whcih encodes the given Triple.
1229        @param t a triple to wrap as a statement
1230        @return a statement wrapping the triple and in this model
1231    */

1232    public Statement asStatement( Triple t )
1233        { return StatementImpl.toStatement( t, this ); }
1234        
1235    public Statement [] asStatements( Triple [] triples )
1236        {
1237        Statement [] result = new Statement [triples.length];
1238        for (int i = 0; i < triples.length; i += 1) result[i] = asStatement( triples[i] );
1239        return result;
1240        }
1241        
1242    public List asStatements( List triples )
1243        {
1244        List L = new ArrayList( triples.size() );
1245        for (int i = 0; i < triples.size(); i += 1) L.add( asStatement( (Triple) triples.get(i) ) );
1246        return L;
1247        }
1248        
1249    public Model asModel( Graph g )
1250        { return new ModelCom( g ); }
1251        
1252    public StmtIterator asStatements( final Iterator it )
1253        { return new StmtIteratorImpl( new Map1Iterator( mapAsStatement, it ) ); }
1254    
1255    protected Map1 mapAsStatement = new Map1()
1256        { public Object JavaDoc map1( Object JavaDoc t ) { return asStatement( (Triple) t ); } };
1257    
1258    public StmtIterator listBySubject( Container cont )
1259        { return listStatements( cont, null, (RDFNode) null ); }
1260
1261    public void close()
1262        { graph.close(); }
1263    
1264    public boolean supportsSetOperations()
1265        {return true;}
1266    
1267    public Model query( Selector selector )
1268        { return createWorkModel() .add( listStatements( selector ) ); }
1269    
1270    public Model union( Model model )
1271        { return createWorkModel() .add(this) .add( model ); }
1272    
1273    /**
1274        Intersect this with another model. As an attempt at optimisation, we try and ensure
1275        we iterate over the smaller model first. Nowadays it's not clear that this is a good
1276        idea, since <code>size()</code> can be expensive on database and inference
1277        models.
1278        
1279        @see com.hp.hpl.jena.rdf.model.Model#intersection(com.hp.hpl.jena.rdf.model.Model)
1280    */

1281    public Model intersection( Model other )
1282        { return this.size() < other.size() ? intersect( this, other ) : intersect( other, this ); }
1283        
1284    /**
1285        Answer a Model that is the intersection of the two argument models. The first
1286        argument is the model iterated over, and the second argument is the one used
1287        to check for membership. [So the first one should be "small" and the second one
1288        "membership cheap".]
1289     */

1290    public static Model intersect( Model smaller, Model larger )
1291        {
1292        Model result = createWorkModel();
1293        StmtIterator it = smaller.listStatements();
1294        try { return addCommon( result, it, larger ); }
1295        finally { it.close(); }
1296        }
1297        
1298    /**
1299        Answer the argument result with all the statements from the statement iterator that
1300        are in the other model added to it.
1301        
1302        @param result the Model to add statements to and return
1303        @param it an iterator over the candidate statements
1304        @param other the model that must contain the statements to be added
1305        @return result, after the suitable statements have been added to it
1306     */

1307    protected static Model addCommon( Model result, StmtIterator it, Model other )
1308        {
1309        while (it.hasNext())
1310            {
1311            Statement s = it.nextStatement();
1312            if (other.contains( s )) result.add( s );
1313            }
1314        return result;
1315        }
1316
1317    public Model difference(Model model) {
1318        Model resultModel = createWorkModel();
1319        StmtIterator iter = null;
1320        Statement stmt;
1321        try {
1322            iter = listStatements();
1323            while (iter.hasNext()) {
1324                stmt = iter.nextStatement();
1325                if (! model.contains(stmt)) {
1326                    resultModel.add(stmt);
1327                }
1328            }
1329            return resultModel;
1330        } finally {
1331            iter.close();
1332        }
1333    }
1334    
1335    public String JavaDoc toString()
1336        { return "<ModelCom " + getGraph() + " | " + reifiedToString() + ">"; }
1337        
1338    public String JavaDoc reifiedToString()
1339        { return statementsToString( getHiddenStatements().listStatements() ); }
1340        
1341    protected String JavaDoc statementsToString( StmtIterator it )
1342        {
1343        StringBuffer JavaDoc b = new StringBuffer JavaDoc();
1344        while (it.hasNext()) b.append( " " ).append( it.nextStatement() );
1345        return b.toString();
1346        }
1347    /**
1348        a read-only Model with all the statements of this Model and any
1349        statements "hidden" by reification. That model is dynamic, ie
1350        any changes this model will be reflected that one.
1351    */

1352    public Model getHiddenStatements()
1353        { return modelReifier.getHiddenStatements(); }
1354        
1355    /**
1356        Answer whether or not these two graphs are isomorphic, taking the
1357        hidden (reification) statements into account.
1358    */

1359    public boolean isIsomorphicWith( Model m )
1360        {
1361        Graph L = ModelFactory.withHiddenStatements( this ).getGraph();
1362        Graph R = ModelFactory.withHiddenStatements( m ).getGraph();
1363        return L.isIsomorphicWith( R );
1364        }
1365        
1366    public synchronized ModelLock getModelLock()
1367    {
1368        if ( modelLock == null )
1369            modelLock = new ModelLockImpl() ;
1370        return modelLock ;
1371    }
1372    
1373    public void enterCriticalSection(boolean requestReadLock)
1374    {
1375        this.getModelLock().enterCriticalSection(requestReadLock) ;
1376    }
1377    
1378    public void leaveCriticalSection()
1379    {
1380        this.getModelLock().leaveCriticalSection() ;
1381    }
1382        
1383    /**
1384        Register the listener with this model by registering its GraphListener
1385        adaption with the underlying Graph.
1386       
1387        @param a ModelChangedListener to register for model events
1388        @return this model, for cascading
1389    */

1390    public Model register( ModelChangedListener listener )
1391        {
1392        getGraph().getEventManager().register( adapt( listener ) );
1393        return this;
1394        }
1395        
1396    /**
1397        Unregister the listener from this model by unregistering its GraphListener
1398        adaption from the underlying Graph.
1399        @param a ModelChangedListener to unregister from model events
1400        @return this model, for cascading
1401    */

1402    public Model unregister( ModelChangedListener listener )
1403        {
1404        getGraph().getEventManager().unregister( adapt( listener ) );
1405        return this;
1406        }
1407        
1408    /**
1409        Answer a GraphListener that, when fed graph-level update events,
1410        fires the corresponding model-level event handlers in <code>L</code>.
1411        @see ModelListenerAdapter
1412        @param L a model listener to be wrapped as a graph listener
1413        @return a graph listener wrapping L
1414    */

1415    public GraphListener adapt( final ModelChangedListener L )
1416        { return new ModelListenerAdapter( this, L ); }
1417    
1418    public Model notifyEvent( Object JavaDoc e )
1419        {
1420        getGraph().getEventManager().notifyEvent( getGraph(), e );
1421        return this;
1422        }
1423    }
1424
1425/*
1426 * (c) Copyright 2001, 2002, 2003, 2004, 2005 Hewlett-Packard Development Company, LP
1427 * All rights reserved.
1428*
1429 * Redistribution and use in source and binary forms, with or without
1430 * modification, are permitted provided that the following conditions
1431 * are met:
1432 * 1. Redistributions of source code must retain the above copyright
1433 * notice, this list of conditions and the following disclaimer.
1434 * 2. Redistributions in binary form must reproduce the above copyright
1435 * notice, this list of conditions and the following disclaimer in the
1436 * documentation and/or other materials provided with the distribution.
1437 * 3. The name of the author may not be used to endorse or promote products
1438 * derived from this software without specific prior written permission.
1439 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1440 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1441 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1442 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1443 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1444 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1445 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1446 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1447 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
1448 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1449 *
1450 * Model.java
1451 *
1452 * Created on 11 March 2001, 16:07
1453 */

1454 
Popular Tags