BrightSide Workbench Full Report + Source Code
org.turro.tags.TagSet Class Reference
Inheritance diagram for org.turro.tags.TagSet:
Collaboration diagram for org.turro.tags.TagSet:

Public Member Functions

 TagSet (Collection<? extends TagItem > c)
 
void select (String tagName)
 
void unselect (String tagName)
 
void toggle (String tagName)
 
void selectAll ()
 
void unselectAll ()
 
void toggle ()
 
String tagUrl (TagItem tag)
 
TreeSet< String > getTagNames ()
 
TreeSet< TagItemgetSelected ()
 
TreeSet< TagItemgetUnselected ()
 
TreeSet< String > getSelectedTagNames ()
 
TreeSet< String > getUnselectedTagNames ()
 
long getMaxUsage ()
 
List< String > getIdentifiers (String root)
 
void markSiblingsFromSelection (String root)
 

Static Public Member Functions

static TagSet empty ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 33 of file TagSet.java.

Constructor & Destructor Documentation

◆ TagSet()

org.turro.tags.TagSet.TagSet ( Collection<? extends TagItem c)

Definition at line 35 of file TagSet.java.

35  {
36  super(c);
37  }
Here is the caller graph for this function:

Member Function Documentation

◆ empty()

static TagSet org.turro.tags.TagSet.empty ( )
static

Definition at line 131 of file TagSet.java.

131  {
132  return new TagSet(Collections.EMPTY_SET);
133  }
TagSet(Collection<? extends TagItem > c)
Definition: TagSet.java:35
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIdentifiers()

List<String> org.turro.tags.TagSet.getIdentifiers ( String  root)

Definition at line 116 of file TagSet.java.

116  {
117  Set<TagItem> set = getSelected();
118  if(!(set == null && set.isEmpty())) {
119  return Tags.getIdentifiers(root, set);
120  }
121  return Collections.EMPTY_LIST;
122  }
TreeSet< TagItem > getSelected()
Definition: TagSet.java:96
Here is the call graph for this function:

◆ getMaxUsage()

long org.turro.tags.TagSet.getMaxUsage ( )

Definition at line 112 of file TagSet.java.

112  {
113  return stream().mapToLong(t -> t.getUsage()).max().orElse(0);
114  }
Here is the caller graph for this function:

◆ getSelected()

TreeSet<TagItem> org.turro.tags.TagSet.getSelected ( )

Definition at line 96 of file TagSet.java.

96  {
97  return new TreeSet(stream().filter(t -> t.isSelected()).collect(Collectors.toSet()));
98  }
Here is the caller graph for this function:

◆ getSelectedTagNames()

TreeSet<String> org.turro.tags.TagSet.getSelectedTagNames ( )

Definition at line 104 of file TagSet.java.

104  {
105  return new TreeSet(stream().filter(t -> t.isSelected()).map(t -> t.getTagName()).collect(Collectors.toSet()));
106  }
Here is the caller graph for this function:

◆ getTagNames()

TreeSet<String> org.turro.tags.TagSet.getTagNames ( )

Definition at line 92 of file TagSet.java.

92  {
93  return new TreeSet(stream().map(t -> t.getTagName()).collect(Collectors.toSet()));
94  }

◆ getUnselected()

TreeSet<TagItem> org.turro.tags.TagSet.getUnselected ( )

Definition at line 100 of file TagSet.java.

100  {
101  return new TreeSet(stream().filter(t -> !t.isSelected()).collect(Collectors.toSet()));
102  }
Here is the caller graph for this function:

◆ getUnselectedTagNames()

TreeSet<String> org.turro.tags.TagSet.getUnselectedTagNames ( )

Definition at line 108 of file TagSet.java.

108  {
109  return new TreeSet(stream().filter(t -> !t.isSelected()).map(t -> t.getTagName()).collect(Collectors.toSet()));
110  }

◆ markSiblingsFromSelection()

void org.turro.tags.TagSet.markSiblingsFromSelection ( String  root)

Definition at line 124 of file TagSet.java.

124  {
125  TagSet siblings = Tags.getSiblings(root, getSelectedTagNames());
126  for(TagItem tag : getUnselected()) {
127  tag.setSibling(siblings.contains(tag));
128  }
129  }
TreeSet< TagItem > getUnselected()
Definition: TagSet.java:100
TreeSet< String > getSelectedTagNames()
Definition: TagSet.java:104
Here is the call graph for this function:

◆ select()

void org.turro.tags.TagSet.select ( String  tagName)

Definition at line 39 of file TagSet.java.

39  {
40  for(TagItem t : this) {
41  if(t.getTagName().equals(tagName)) {
42  t.setSelected(true);
43  }
44  }
45  }
Here is the call graph for this function:

◆ selectAll()

void org.turro.tags.TagSet.selectAll ( )

Definition at line 70 of file TagSet.java.

70  {
71  for(TagItem t : this) {
72  t.setSelected(true);
73  }
74  }
Here is the call graph for this function:

◆ tagUrl()

String org.turro.tags.TagSet.tagUrl ( TagItem  tag)

Definition at line 88 of file TagSet.java.

88  {
89  return MarkerHelper.setObfuscatedRightNowPars("tag=" + tag.getTagName());
90  }
Here is the call graph for this function:

◆ toggle() [1/2]

void org.turro.tags.TagSet.toggle ( )

Definition at line 82 of file TagSet.java.

82  {
83  for(TagItem t : this) {
84  t.setSelected(!t.isSelected());
85  }
86  }
Here is the call graph for this function:

◆ toggle() [2/2]

void org.turro.tags.TagSet.toggle ( String  tagName)

Definition at line 55 of file TagSet.java.

55  {
56  for(TagItem t : this) {
57  if(t.getTagName().equals(tagName)) {
58  if(t.isSelected()) {
59  t.setSelected(false);
60  } else if(t.isSibling()) {
61  t.setSelected(true);
62  } else {
63  unselectAll();
64  t.setSelected(true);
65  }
66  }
67  }
68  }
Here is the call graph for this function:

◆ unselect()

void org.turro.tags.TagSet.unselect ( String  tagName)

Definition at line 47 of file TagSet.java.

47  {
48  for(TagItem t : this) {
49  if(t.getTagName().equals(tagName)) {
50  t.setSelected(false);
51  }
52  }
53  }
Here is the call graph for this function:

◆ unselectAll()

void org.turro.tags.TagSet.unselectAll ( )

Definition at line 76 of file TagSet.java.

76  {
77  for(TagItem t : this) {
78  t.setSelected(false);
79  }
80  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: