Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acs.damsel.srvr.schema
Class MetaDataTag  view MetaDataTag download MetaDataTag.java

java.lang.Object
  extended byorg.acs.damsel.srvr.schema.MetaDataTag
All Implemented Interfaces:
java.io.Serializable

public class MetaDataTag
extends java.lang.Object
implements java.io.Serializable

Title: MetaDataTag

Description: MetaDataTag holds a name for a tag (i.e., "Title", "Description", etc) as well as a vocabulary list for tags with a controlled vocabulary (as opposed to free-form tags). The class overrides the Object equals() method with one that only compares the Tag name. Thus, tag names must be unique, even if their other properties, such as having a controlled vocabulary list, are not.

Version:
1.0

Field Summary
private  boolean controlledVocabulary
           
private static org.apache.log4j.Logger log
           
private  java.lang.String name
           
private  java.util.Vector vocabulary
           
 
Constructor Summary
MetaDataTag()
          Default constructor
 
Method Summary
 void addVocabularyWord(java.lang.String word)
          Method adds a word to the controlled vocabulary list of the MetaDataTag.
 boolean equals(java.lang.Object tag)
          Determine whether this Object is semantically equal to another Object.
 java.lang.String getName()
           
 java.util.Vector getVocabulary()
           
 boolean isControlledVocabulary()
          Method returns true if the metadatatag has a controlled vocabulary list, false otherwise.
 boolean isInVocabulary(java.lang.String word)
          Method checks if the specified word is in the vocabulary list.
 void removeVocabularyWord(java.lang.String word)
          removeVocabularyWord is similar to addVocabularyWord, except that a ControlledVocabularyException is thrown if the word does not exist in the controlled vocabulary list or if the MetaDataTag does not have a controlled vocabulary.
 void setControlledVocabulary(boolean controlledVocabulary)
           
 void setName(java.lang.String name)
           
 void setVocabulary(java.util.Vector vocabulary)
           
 java.util.Iterator vocabularyIterator()
          Method returns an interator of all words in the conrolled vocabulary list.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private java.lang.String name

controlledVocabulary

private boolean controlledVocabulary

vocabulary

private java.util.Vector vocabulary

log

private static org.apache.log4j.Logger log
Constructor Detail

MetaDataTag

public MetaDataTag()
Default constructor

Method Detail

addVocabularyWord

public void addVocabularyWord(java.lang.String word)
                       throws ControlledVocabularyException
Method adds a word to the controlled vocabulary list of the MetaDataTag. If the word already exists in the list or the MetaDataTag is not a controlled vocabulary tag, a ControlledVocabularyException is thrown.


removeVocabularyWord

public void removeVocabularyWord(java.lang.String word)
                          throws ControlledVocabularyException
removeVocabularyWord is similar to addVocabularyWord, except that a ControlledVocabularyException is thrown if the word does not exist in the controlled vocabulary list or if the MetaDataTag does not have a controlled vocabulary.


isInVocabulary

public boolean isInVocabulary(java.lang.String word)
Method checks if the specified word is in the vocabulary list.


vocabularyIterator

public java.util.Iterator vocabularyIterator()
Method returns an interator of all words in the conrolled vocabulary list.


isControlledVocabulary

public boolean isControlledVocabulary()
Method returns true if the metadatatag has a controlled vocabulary list, false otherwise.


getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

setControlledVocabulary

public void setControlledVocabulary(boolean controlledVocabulary)

equals

public boolean equals(java.lang.Object tag)
Description copied from class: java.lang.Object
Determine whether this Object is semantically equal to another Object.

There are some fairly strict requirements on this method which subclasses must follow:

  • It must be transitive. If a.equals(b) and b.equals(c), then a.equals(c) must be true as well.
  • It must be symmetric. a.equals(b) and b.equals(a) must have the same value.
  • It must be reflexive. a.equals(a) must always be true.
  • It must be consistent. Whichever value a.equals(b) returns on the first invocation must be the value returned on all later invocations.
  • a.equals(null) must be false.
  • It must be consistent with hashCode(). That is, a.equals(b) must imply a.hashCode() == b.hashCode(). The reverse is not true; two objects that are not equal may have the same hashcode, but that has the potential to harm hashing performance.

This is typically overridden to throw a java.lang.ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for a.equals(b) to be true even though a.getClass() != b.getClass(). Also, it is typical to never cause a java.lang.NullPointerException.

In general, the Collections API (java.util) use the equals method rather than the == operator to compare objects. However, java.util.IdentityHashMap is an exception to this rule, for its own good reasons.

The default implementation returns this == o.


getVocabulary

public java.util.Vector getVocabulary()

setVocabulary

public void setVocabulary(java.util.Vector vocabulary)