Created
April 7, 2012 05:28
-
-
Save yamanyar/2325538 to your computer and use it in GitHub Desktop.
CanonicalSet example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private CanonicalSet<relation> repository = | |
CanonicalSet.newInstance(Relation.class); | |
public Relation getSharedInstance(Relation relation) { | |
if (active) { | |
//following method is not in set interface. it returns the equivalent object from set for the given relation | |
final ImmutableRelation immutableRelation = new ImmutableRelation(relation); | |
return repository.unique(immutableRelation); | |
} else { | |
return relation; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment