Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.hp.hpl.jena.enhanced
Class Polymorphic

    java.lang.Object
      com.hp.hpl.jena.enhanced.Polymorphic

Direct Known Subclasses:
  EnhGraph, EnhNode

    public abstract class Polymorphic

extends java.lang.Object

Abstract base class for all polymorphic RDF objects, especially enhanced node and enhanced graph.

Author:
  Jeremy Carroll (original code)
  Chris Dollin (original code)
  Ian Dickinson (tidying up and comments)

Method Summary
`void` | `addView(Polymorphic other)` add another view for this object.
`abstract boolean` | `equals(java.lang.Object o)` subclasses must override equals.
`abstract boolean` | `isValid()` answer true iff this enhanced node is still underpinned in the graph by triples appropriate to its type.
`boolean` | `supports(java.lang.Class t)` return _true_ iff this polymorphic object supports the specified interface.

Methods inherited from class java.lang.Object
`getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### supports

    public boolean supports(java.lang.Class t)

  return _true_ iff this polymorphic object supports the specified interface. Synonymous with "does the argument class have this as an instance". Actually it shouldn't be. Review.

### isValid

    public abstract boolean isValid()

  answer true iff this enhanced node is still underpinned in the graph by triples appropriate to its type.

### equals

    public abstract boolean equals(java.lang.Object o)

  subclasses must override equals. Actually they may not have to nowadays ... I have expunged the clever facet-identity test (and indeed facets).

  Overrides:
    `equals` in class `java.lang.Object`

### addView

    public void addView(Polymorphic other)

  add another view for this object. `other` must be freshly constructed. To be called by subclasses when they have constructed a new view for this object.

  The method is synchronised because addView is an update operation that may happen in a read context (because of .as()). Synchronising it ensures that simultaneous updates don't end up leaving the rings in an inconsistent state. (It's not clear whether this would actually lead to any problems; it's hard to write tests to expose these issues.) This method is public ONLY so that it can be tested. TODO find a better way to make it testable.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP