Documentation of 'us.bpsm.edn.Tag' Java class
Tag
us.bpsm.edn

Class Tag

  • All Implemented Interfaces:
    java.lang.Comparable<Tag>, Named


    public final class Tag
    extends java.lang.Object
    implements Named, java.lang.Comparable<Tag>
    A Tag is Named. Additionally it obeys the syntactic restrictions defined for edn Symbols.

    Note: Tags print with a leading hash, but this is not part of the tag's name:

      // For the tag "#foo/bar"
     Tag t = newTag("foo", "bar");
     t.getName()   => "bar"
     t.getPrefix() => "foo"
     t.toString()  => "#foo/bar"
     
    • Field Summary

      • Fields inherited from interface us.bpsm.edn.Named

        EMPTY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compareTo(Tag o) 
      boolean equals(java.lang.Object obj) 
      java.lang.String getName()
      The name of this named thing, not including any prefix.
      java.lang.String getPrefix()
      The prefix, (also called namespace), which may be empty.
      int hashCode() 
      static Tag newTag(java.lang.String name)
      This is equivalent to newTag("", name).
      static Tag newTag(java.lang.String prefix, java.lang.String name)
      Provide a Tag with the given prefix and name.
      static Tag newTag(Symbol sym)
      Return a Tag with the same prefix and name as sym.
      java.lang.String toString() 
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getPrefix

        public final java.lang.String getPrefix()
        The prefix, (also called namespace), which may be empty. A Named object with an empty prefix is said to have no prefix.
        Specified by:
        getPrefix in interface Named
        Returns:
        a possibly empty string; never null.
      • getName

        public final java.lang.String getName()
        The name of this named thing, not including any prefix.
        Specified by:
        getName in interface Named
        Returns:
        a non-empty string.
      • newTag

        public static Tag newTag(Symbol sym)
        Return a Tag with the same prefix and name as sym.
        Parameters:
        sym - a Symbol, never null
        Returns:
        a Tag with the same prefix and name as sym.
      • newTag

        public static Tag newTag(java.lang.String prefix,
                                 java.lang.String name)
        Provide a Tag with the given prefix and name.

        Bear in mind that tags with no prefix are reserved for use by the edn format itself.

        Parameters:
        prefix - An empty String or a non-empty String obeying the restrictions specified by edn. Never null.
        name - A non-empty string obeying the restrictions specified by edn. Never null.
        Returns:
        a Keyword, never null.
      • newTag

        public static Tag newTag(java.lang.String name)
        This is equivalent to newTag("", name).
        Parameters:
        name - A non-empty string obeying the restrictions specified by edn. Never null.
        Returns:
        a Tag without a prefix, never null.
        See Also:
        newTag(String, String)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo(Tag o)
        Specified by:
        compareTo in interface java.lang.Comparable<Tag>

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.