Package com.im.ijc.cf.api
Class CFBinSet
- java.lang.Object
-
- com.im.ijc.cf.api.CFAbstractItem
-
- com.im.ijc.cf.api.CFNamedItem
-
- com.im.ijc.cf.api.CFBinSet
-
public final class CFBinSet extends CFNamedItem
Set ofbin
s (categories) for classification.- Author:
- Petr Hamernik
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_BINS
Property name for bins property.-
Fields inherited from class com.im.ijc.cf.api.CFNamedItem
PROP_DISPLAY_NAME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CFBin
addBin(java.lang.String displayName, CFFormatter formatter)
Add new bin to this bin set and return it.void
addChangeListener(javax.swing.event.ChangeListener listener)
Add change listener to know about any change in this CFBinSet and in all of its CFBins.boolean
contains(CFBin bin)
Does this bin set contains the given bin?boolean
equals(java.lang.Object obj)
CFBin
findBinById(java.lang.String id)
Find bin by its id.java.lang.String
getAsHTML()
java.util.List<CFBin>
getBins()
Get list of bins which belong to this bin set.java.lang.String
getId()
Get unique ID of this bin set.int
hashCode()
void
removeBin(CFBin bin)
Remove the bin.void
removeChangeListener(javax.swing.event.ChangeListener listener)
CFBin
restoreBin(java.lang.String displayName, java.lang.String id, CFFormatter formatter)
Do NOT use: only for persistence.-
Methods inherited from class com.im.ijc.cf.api.CFNamedItem
getDisplayName, setDisplayName
-
Methods inherited from class com.im.ijc.cf.api.CFAbstractItem
addPropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
PROP_BINS
public static final java.lang.String PROP_BINS
Property name for bins property.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBins
public java.util.List<CFBin> getBins()
Get list of bins which belong to this bin set.- Returns:
- list of bins
-
addBin
public CFBin addBin(java.lang.String displayName, CFFormatter formatter)
Add new bin to this bin set and return it.- Parameters:
displayName
- Display name of a new binformatter
- Formatter for a new bin- Returns:
- the newly created instance of bin.
-
restoreBin
public CFBin restoreBin(java.lang.String displayName, java.lang.String id, CFFormatter formatter)
Do NOT use: only for persistence.- Parameters:
displayName
- display nameid
- id of the binformatter
- formatting params- Returns:
- new bin
-
removeBin
public void removeBin(CFBin bin)
Remove the bin.- Parameters:
bin
- The bin to be removed
-
contains
public boolean contains(CFBin bin)
Does this bin set contains the given bin?- Parameters:
bin
- The bin to be tested.- Returns:
true
if bin is there,false
otherwise.
-
findBinById
public CFBin findBinById(java.lang.String id)
Find bin by its id. Can return null.- Parameters:
id
- The id to be searched- Returns:
- bin instance of null
-
getId
public java.lang.String getId()
Get unique ID of this bin set.- Returns:
- unique ID in its classifier.
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener listener)
Add change listener to know about any change in this CFBinSet and in all of its CFBins. It means you don't need to register PropertyChangeListener to each bin, but you can be notified through this single listener about all changes in the hierarchy (e.g. when some bin changes its CFFormatter)- Parameters:
listener
- Listener to be added
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener listener)
-
getAsHTML
public java.lang.String getAsHTML()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-