Class Atom

java.lang.Object
com.iizix.prop.Atom
All Implemented Interfaces:
Cloneable, Comparable<Atom>
Direct Known Subclasses:
GeneratedAtom

public class Atom extends Object implements Cloneable, Comparable<Atom>
The Atom object instance is used to access the name string for e.g. properties. A name string that has been placed in an atom table is called an atom name.

The name string is subject to the following name string rules:

  • cannot be empty,
  • code point for each character must be space or greater, i.e. no control characters,
  • reserved characters: single- and double-quote, colon (:), forward and backslash (/\), curly brackets ({}) used in expressions, wild card characters (?*^), enumeration separators (,;).

The string itself is implemented as a weak reference, enabling the editor to keep a weak hash map with weak references.

Author:
Christopher Mindus
  • Field Details Link icon

    • RESERVED_CHARS Link icon

      public static final String RESERVED_CHARS
      Reserved characters in Atom names.
      See Also:
    • SYSTEM Link icon

      public static final Atom SYSTEM
    • SERVER Link icon

      public static final Atom SERVER
    • CLIENT Link icon

      public static final Atom CLIENT
    • EVENT Link icon

      public static final Atom EVENT
    • ENV Link icon

      public static final Atom ENV
    • ERROR Link icon

      public static final Atom ERROR
    • INDEX Link icon

      public static final Atom INDEX
    • APPS Link icon

      public static final Atom APPS
    • FILENAME Link icon

      public static final Atom FILENAME
    • ROOT Link icon

      public static final Atom ROOT
    • ICON Link icon

      public static final Atom ICON
    • BINDINGS Link icon

      public static final Atom BINDINGS
    • PORT Link icon

      public static final Atom PORT
    • BIND Link icon

      public static final Atom BIND
    • RESOLVE Link icon

      public static final Atom RESOLVE
    • HOST Link icon

      public static final Atom HOST
    • SSL Link icon

      public static final Atom SSL
    • PROXYHOST Link icon

      public static final Atom PROXYHOST
    • PROXYPORT Link icon

      public static final Atom PROXYPORT
    • PROXYTYPE Link icon

      public static final Atom PROXYTYPE
    • WEBSOCKET Link icon

      public static final Atom WEBSOCKET
    • USER Link icon

      public static final Atom USER
    • EXTENDS Link icon

      public static final Atom EXTENDS
    • STYLES Link icon

      public static final Atom STYLES
    • CLIENT_STYLES Link icon

      public static final Atom CLIENT_STYLES
    • SETTINGS Link icon

      public static final Atom SETTINGS
    • ROWS Link icon

      public static final Atom ROWS
    • RAW Link icon

      public static final Atom RAW
    • NULL Link icon

      public static final Atom NULL
    • ACTORS Link icon

      public static final Atom ACTORS
    • PATTERN Link icon

      public static final Atom PATTERN
    • FOCUS Link icon

      public static final Atom FOCUS
    • TRANSACTION Link icon

      public static final Atom TRANSACTION
    • CONNECTORS Link icon

      public static final Atom CONNECTORS
    • TYPE Link icon

      public static final Atom TYPE
    • COMPONENTS Link icon

      public static final Atom COMPONENTS
    • COMPONENT Link icon

      public static final Atom COMPONENT
    • UI_CONTAINER Link icon

      public static final Atom UI_CONTAINER
    • UI_COMPONENT Link icon

      public static final Atom UI_COMPONENT
    • UI_PREVIEW Link icon

      public static final Atom UI_PREVIEW
    • VISIBLE Link icon

      public static final Atom VISIBLE
    • ENABLED Link icon

      public static final Atom ENABLED
    • READONLY Link icon

      public static final Atom READONLY
    • SELECTED Link icon

      public static final Atom SELECTED
    • SELECTOR Link icon

      public static final Atom SELECTOR
    • LAYOUT Link icon

      public static final Atom LAYOUT
    • LAYOUT_MANAGER Link icon

      public static final Atom LAYOUT_MANAGER
    • TEXT Link icon

      public static final Atom TEXT
    • CHARUPDATE Link icon

      public static final Atom CHARUPDATE
    • DATA_CONTAINER Link icon

      public static final Atom DATA_CONTAINER
    • PANEL Link icon

      public static final Atom PANEL
    • HSCROLL Link icon

      public static final Atom HSCROLL
    • VSCROLL Link icon

      public static final Atom VSCROLL
    • TITLE Link icon

      public static final Atom TITLE
    • TOOLTIP Link icon

      public static final Atom TOOLTIP
    • MESSAGE Link icon

      public static final Atom MESSAGE
    • TOASTER Link icon

      public static final Atom TOASTER
    • BADGE Link icon

      public static final Atom BADGE
    • PLUGINS Link icon

      public static final Atom PLUGINS
    • CLASS Link icon

      public static final Atom CLASS
    • INPUT Link icon

      public static final Atom INPUT
    • BODY Link icon

      public static final Atom BODY
    • OUTPUT Link icon

      public static final Atom OUTPUT
    • JAVA Link icon

      public static final Atom JAVA
    • TIMESTAMP Link icon

      public static final Atom TIMESTAMP
    • WIDTH Link icon

      public static final Atom WIDTH
    • HEIGHT Link icon

      public static final Atom HEIGHT
    • FIELDS Link icon

      public static final Atom FIELDS
    • CID Link icon

      public static final Atom CID
    • ID Link icon

      public static final Atom ID
    • IDS Link icon

      public static final Atom IDS
    • ACTION Link icon

      public static final Atom ACTION
    • ACTIONS Link icon

      public static final Atom ACTIONS
    • ALIGN Link icon

      public static final Atom ALIGN
    • RTL Link icon

      public static final Atom RTL
    • LOCATION Link icon

      public static final Atom LOCATION
    • DELAY Link icon

      public static final Atom DELAY
    • DERIVES Link icon

      public static final Atom DERIVES
    • VSFIELD Link icon

      public static final Atom VSFIELD
    • VSTABLE Link icon

      public static final Atom VSTABLE
    • VSCOLUMN Link icon

      public static final Atom VSCOLUMN
    • QNAME Link icon

      public static final Atom QNAME
    • NAME Link icon

      public static final Atom NAME
    • ENCODING Link icon

      public static final Atom ENCODING
    • REFERENCE Link icon

      public static final Atom REFERENCE
    • VIRTUALSPACE Link icon

      public static final Atom VIRTUALSPACE
    • PARTICIPANTS Link icon

      public static final Atom PARTICIPANTS
    • PRIMARY Link icon

      public static final Atom PRIMARY
    • VALUE Link icon

      public static final Atom VALUE
    • MSG Link icon

      public static final Atom MSG
    • MCAT Link icon

      public static final Atom MCAT
    • DESCR Link icon

      public static final Atom DESCR
    • DEFAULT Link icon

      public static final Atom DEFAULT
    • GEO Link icon

      public static final Atom GEO
    • ZONES Link icon

      public static final Atom ZONES
    • LANG Link icon

      public static final Atom LANG
    • THEMES Link icon

      public static final Atom THEMES
    • DEVICE Link icon

      public static final Atom DEVICE
    • URI Link icon

      public static final Atom URI
    • URI_PARAMS Link icon

      public static final Atom URI_PARAMS
    • METHOD Link icon

      public static final Atom METHOD
    • OVERRIDE_METHOD Link icon

      public static final Atom OVERRIDE_METHOD
    • READ_TIMEOUT Link icon

      public static final Atom READ_TIMEOUT
    • IGNORE Link icon

      public static final Atom IGNORE
    • DOC Link icon

      public static final Atom DOC
    • CACHE Link icon

      public static final Atom CACHE
    • STYLE Link icon

      public static final Atom STYLE
    • WEIGHT Link icon

      public static final Atom WEIGHT
    • RANGE Link icon

      public static final Atom RANGE
    • CONTEXT_MENU Link icon

      public static final Atom CONTEXT_MENU
    • CONTEXT_MENU_REF Link icon

      public static final Atom CONTEXT_MENU_REF
    • CSS_CLASSNAME Link icon

      public static final Atom CSS_CLASSNAME
    • DESIGNER Link icon

      public static final Atom DESIGNER
    • MODULE_APP Link icon

      public static final Atom MODULE_APP
    • PWA Link icon

      public static final Atom PWA
    • PUSH Link icon

      public static final Atom PUSH
    • ON_VS_CREATE Link icon

      public static final String ON_VS_CREATE
      See Also:
    • ON_VS_DESTROY Link icon

      public static final String ON_VS_DESTROY
      See Also:
    • ON_VS_ACTION Link icon

      public static final String ON_VS_ACTION
      See Also:
    • ON_VS_CHANGE Link icon

      public static final String ON_VS_CHANGE
      See Also:
    • ON_VS_FOCUS Link icon

      public static final String ON_VS_FOCUS
      See Also:
    • ON_VS_STATE Link icon

      public static final String ON_VS_STATE
      See Also:
    • ON_UI_CONNECT Link icon

      public static final String ON_UI_CONNECT
      See Also:
    • ON_UI_CREATE Link icon

      public static final String ON_UI_CREATE
      See Also:
    • ON_UI_DESTROY Link icon

      public static final String ON_UI_DESTROY
      See Also:
    • ON_UI_ACTION Link icon

      public static final String ON_UI_ACTION
      See Also:
    • ON_UI_BACK Link icon

      public static final String ON_UI_BACK
      See Also:
    • ON_UI_TEXT_CHANGE Link icon

      public static final String ON_UI_TEXT_CHANGE
      See Also:
    • ON_UI_VALUE_CHANGE Link icon

      public static final String ON_UI_VALUE_CHANGE
      See Also:
    • ON_UI_FOCUS Link icon

      public static final String ON_UI_FOCUS
      See Also:
    • ON_UI_SELECTION Link icon

      public static final String ON_UI_SELECTION
      See Also:
    • ATOM_ON_VS_CREATE Link icon

      public static final Atom ATOM_ON_VS_CREATE
    • ATOM_ON_VS_DESTROY Link icon

      public static final Atom ATOM_ON_VS_DESTROY
    • ATOM_ON_VS_ACTION Link icon

      public static final Atom ATOM_ON_VS_ACTION
    • ATOM_ON_VS_CHANGE Link icon

      public static final Atom ATOM_ON_VS_CHANGE
    • ATOM_ON_VS_FOCUS Link icon

      public static final Atom ATOM_ON_VS_FOCUS
    • ATOM_ON_VS_STATE Link icon

      public static final Atom ATOM_ON_VS_STATE
    • ATOM_ON_UI_CONNECT Link icon

      public static final Atom ATOM_ON_UI_CONNECT
    • ATOM_ON_UI_CREATE Link icon

      public static final Atom ATOM_ON_UI_CREATE
    • ATOM_ON_UI_DESTROY Link icon

      public static final Atom ATOM_ON_UI_DESTROY
    • ATOM_ON_UI_ACTION Link icon

      public static final Atom ATOM_ON_UI_ACTION
    • ATOM_ON_UI_BACK Link icon

      public static final Atom ATOM_ON_UI_BACK
    • ATOM_ON_UI_TEXT_CHANGE Link icon

      public static final Atom ATOM_ON_UI_TEXT_CHANGE
    • ATOM_ON_UI_VALUE_CHANGE Link icon

      public static final Atom ATOM_ON_UI_VALUE_CHANGE
    • ATOM_ON_UI_FOCUS Link icon

      public static final Atom ATOM_ON_UI_FOCUS
    • ATOM_ON_UI_SELECTION Link icon

      public static final Atom ATOM_ON_UI_SELECTION
    • VSFIELD_NAME Link icon

      public static final String VSFIELD_NAME
      See Also:
  • Constructor Details Link icon

    • Atom Link icon

      protected Atom(String name, int internalValue)
      This method is ONLY intended to be used by GAtom!
      Throws:
      IllegalArgumentException - If not internal...
  • Method Details Link icon

    • get Link icon

      public static Atom get(String name)
      Gets an existing or creates a new atom with the specified name.
      Parameters:
      name - The atom name, following the rules.
      Throws:
      NullPointerException - If the name is null.
      IllegalArgumentException - If the name is invalid.
    • find Link icon

      public static Atom find(String name)
      Finds an atom that has been created previously by name, and that is still in use by some non-garbage-collected object.
      Parameters:
      name - The name.
      Returns:
      The Atom for the name, or null if not found.
    • isValidName Link icon

      public static boolean isValidName(String name)
      Validates the atom name (apart of the leading '$' sign that should not be used unless for system defines).
      Parameters:
      name - The atom name to verify.
      Returns:
      true for success, false for invalid name.
    • isValidName Link icon

      public static boolean isValidName(String name, boolean allowLeadingDollar)
      Validates the atom name.
      Parameters:
      name - The atom name to verify.
      allowLeadingDollar - Flag indicating leading dollar is allowed or not.
      Returns:
      true for success, false for invalid name.
    • validateName Link icon

      public static String validateName(String name)
      Validates the atom name (apart of the leading '$' sign that should not be used unless for system defines).
      Parameters:
      name - The atom name to verify.
      Returns:
      The error message in English such as "cannot be empty" or "cannot contain...", or null for successful validation.
    • validateName Link icon

      public static String validateName(String name, boolean allowLeadingDollar)
      Validates the atom name (apart of the leading '$' sign that should not be used unless for system defines).
      Parameters:
      name - The atom name to verify.
      allowLeadingDollar - Flag indicating leading dollar is allowed or not.
      Returns:
      The error message in English such as "cannot be empty" or "cannot contain...", or null for successful validation.
    • createValidName Link icon

      public static String createValidName(String string, boolean isLeadingDollarAllowed)
      Creates a valid name from a string. Only valid characters are used. If the name becomes empty, it will be returned as empty to be used for e.g. unique name creation, even if it is not allowed.
      Parameters:
      string - The suggested name.
      isLeadingDollarAllowed - Leading '$' is allowed depending on flag.
    • isInside Link icon

      public static boolean isInside(Atom atom, Atom[] atoms)
      Checks if an Atom is present in an array of Atoms.
      Parameters:
      atom - The atom to find.
      atoms - The atom array.
      Returns:
      true if atom found in the atoms table.
    • equals Link icon

      public boolean equals(Object atom)
      Checks if an atom equals to another.
      Overrides:
      equals in class Object
      Parameters:
      atom - the atom to compare...
      Returns:
      true if the atom is equal to this object instance by reference ("==").
    • compareTo Link icon

      public int compareTo(Atom atom)
      Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Specified by:
      compareTo in interface Comparable<Atom>
      Parameters:
      atom - The object to be compared.
      Returns:
      A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The comparison is done with a Collator with the Default Locale.
      Throws:
      NullPointerException - if the specified object is null.
      ClassCastException - if the specified object's type prevents it from being compared to this object.
    • getAtomName Link icon

      public String getAtomName()
      Gets the atom name.
      Returns:
      the name of the atom.
    • toString Link icon

      public String toString()
      Converts the atom to a string in the format of atom[name].
      Overrides:
      toString in class Object
    • hashCode Link icon

      public int hashCode()
      Gets the hash code of the Atom, i.e. the hash code of the Atom Name.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of the Atom Name.
    • clone Link icon

      public Atom clone()
      Clones this atom.

      Atoms do not need cloning, and this method returns the same Atom object as the name is invariable.

      Overrides:
      clone in class Object
      Returns:
      A "clone" of the atom, i.e. the same "this" Atom object.